Correctly get source for metadata crate type;

replace `unwrap()` with `expect()`
This commit is contained in:
Austin Bonander 2017-03-15 01:27:43 -07:00 committed by Peter Atashian
parent 58c701f5c7
commit a906d9912b
No known key found for this signature in database
GPG Key ID: DE04D9E27559BC8A

View File

@ -236,7 +236,8 @@ impl<'a> CrateLoader<'a> {
// path (this is a top-level dependency) as we don't want to
// implicitly load anything inside the dependency lookup path.
let prev_kind = source.dylib.as_ref().or(source.rlib.as_ref())
.unwrap().1;
.or(source.rmeta.as_ref())
.expect("No sources for crate").1;
if ret.is_none() && (prev_kind == kind || prev_kind == PathKind::All) {
ret = Some(cnum);
}