Skip to content

Commit e0c1707

Browse files
committed
Changes from the review of the @str PR.
1 parent f502576 commit e0c1707

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,7 @@ impl CStore {
215215
debug!(" hash[{}]: {}", x.name, x.hash);
216216
}
217217

218-
let mut hashes = ~[];
219-
for ch in result.move_iter() {
220-
let crate_hash {
221-
hash,
222-
..
223-
} = ch;
224-
hashes.push(hash)
225-
}
226-
hashes
218+
result.move_iter().map(|crate_hash { hash, ..}| hash).collect()
227219
}
228220
}
229221

src/librustdoc/clean.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -878,16 +878,13 @@ fn path_to_str(p: &ast::Path) -> ~str {
878878

879879
let mut s = ~"";
880880
let mut first = true;
881-
for i in p.segments.iter().map(|x| {
882-
let string = token::get_ident(x.identifier.name);
883-
string.get().to_str()
884-
}) {
881+
for i in p.segments.iter().map(|x| token::get_ident(x.identifier.name)) {
885882
if !first || p.global {
886883
s.push_str("::");
887884
} else {
888885
first = false;
889886
}
890-
s.push_str(i);
887+
s.push_str(i.get());
891888
}
892889
s
893890
}

src/libsyntax/parse/token.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,6 @@ pub struct InternedString {
554554
priv string: RcStr,
555555
}
556556

557-
#[unsafe_destructor]
558-
impl Drop for InternedString {
559-
fn drop(&mut self) {
560-
// No-op just to make this not implicitly copyable.
561-
}
562-
}
563-
564557
impl InternedString {
565558
#[inline]
566559
pub fn new(string: &'static str) -> InternedString {

0 commit comments

Comments
 (0)