Replace a few expect+format combos with unwrap_or_else+panic

This commit is contained in:
ljedrz 2018-07-23 14:47:13 +02:00
parent 210d61f05c
commit fe588d894f
5 changed files with 8 additions and 8 deletions

View file

@ -1277,7 +1277,7 @@ pub fn provide(providers: &mut Providers) {
all.iter()
.find(|cgu| *cgu.name() == name)
.cloned()
.expect(&format!("failed to find cgu with name {:?}", name))
.unwrap_or_else(|| panic!("failed to find cgu with name {:?}", name))
};
providers.compile_codegen_unit = compile_codegen_unit;