Use Option::map_or instead of .map(..).unwrap_or(..)
This commit is contained in:
parent
d03fe84169
commit
a56bffb4f9
50 changed files with 67 additions and 79 deletions
|
@ -326,7 +326,7 @@ impl<'a> CrateLoader<'a> {
|
|||
self.verify_no_symbol_conflicts(&crate_root)?;
|
||||
|
||||
let private_dep =
|
||||
self.sess.opts.externs.get(&name.as_str()).map(|e| e.is_private_dep).unwrap_or(false);
|
||||
self.sess.opts.externs.get(&name.as_str()).map_or(false, |e| e.is_private_dep);
|
||||
|
||||
// Claim this crate number and cache it
|
||||
let cnum = self.cstore.alloc_new_crate_num();
|
||||
|
|
|
@ -132,7 +132,7 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
|
|||
|
||||
impl Collector<'tcx> {
|
||||
fn register_native_lib(&mut self, span: Option<Span>, lib: NativeLib) {
|
||||
if lib.name.as_ref().map(|&s| s == kw::Empty).unwrap_or(false) {
|
||||
if lib.name.as_ref().map_or(false, |&s| s == kw::Empty) {
|
||||
match span {
|
||||
Some(span) => {
|
||||
struct_span_err!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue