Correctly get source for metadata crate type;
replace `unwrap()` with `expect()`
This commit is contained in:
parent
58c701f5c7
commit
a906d9912b
|
@ -236,7 +236,8 @@ impl<'a> CrateLoader<'a> {
|
||||||
// path (this is a top-level dependency) as we don't want to
|
// path (this is a top-level dependency) as we don't want to
|
||||||
// implicitly load anything inside the dependency lookup path.
|
// implicitly load anything inside the dependency lookup path.
|
||||||
let prev_kind = source.dylib.as_ref().or(source.rlib.as_ref())
|
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) {
|
if ret.is_none() && (prev_kind == kind || prev_kind == PathKind::All) {
|
||||||
ret = Some(cnum);
|
ret = Some(cnum);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue