Skip to content

Commit 60b0dd5

Browse files
author
Jorge Aparicio
committed
librustc_trans: fix fallout
1 parent 56ecb51 commit 60b0dd5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc_driver/pretty.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub fn parse_pretty(sess: &Session, name: &str) -> (PpMode, Option<UserIdentifie
7878
or `expanded,identified`; got {}", name).as_slice());
7979
}
8080
};
81-
let opt_second = opt_second.and_then::<UserIdentifiedItem>(from_str);
81+
let opt_second = opt_second.and_then::<UserIdentifiedItem, _>(from_str);
8282
(first, opt_second)
8383
}
8484

@@ -313,14 +313,12 @@ pub enum UserIdentifiedItem {
313313

314314
impl FromStr for UserIdentifiedItem {
315315
fn from_str(s: &str) -> Option<UserIdentifiedItem> {
316-
let extract_path_parts = || {
316+
from_str(s).map(ItemViaNode).or_else(|| {
317317
let v : Vec<_> = s.split_str("::")
318318
.map(|x|x.to_string())
319319
.collect();
320320
Some(ItemViaPath(v))
321-
};
322-
323-
from_str(s).map(ItemViaNode).or_else(extract_path_parts)
321+
})
324322
}
325323
}
326324

0 commit comments

Comments
 (0)