Replace deref with as_deref
This commit is contained in:
parent
f2a97210b2
commit
59634bc1d4
10 changed files with 11 additions and 11 deletions
|
|
@ -941,7 +941,7 @@ impl<'a> State<'a> {
|
|||
self.maybe_print_comment(st.span.lo());
|
||||
match st.node {
|
||||
hir::StmtKind::Local(ref loc) => {
|
||||
self.print_local(loc.init.deref(), |this| this.print_local_decl(&loc));
|
||||
self.print_local(loc.init.as_deref(), |this| this.print_local_decl(&loc));
|
||||
}
|
||||
hir::StmtKind::Item(item) => {
|
||||
self.ann.nested(self, Nested::Item(item))
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
tcx.mk_unit()
|
||||
}
|
||||
ExprKind::Break(destination, ref expr_opt) => {
|
||||
self.check_expr_break(destination, expr_opt.deref(), expr)
|
||||
self.check_expr_break(destination, expr_opt.as_deref(), expr)
|
||||
}
|
||||
ExprKind::Continue(destination) => {
|
||||
if destination.target_id.is_ok() {
|
||||
|
|
@ -237,7 +237,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
ExprKind::Ret(ref expr_opt) => {
|
||||
self.check_expr_return(expr_opt.deref(), expr)
|
||||
self.check_expr_return(expr_opt.as_deref(), expr)
|
||||
}
|
||||
ExprKind::Assign(ref lhs, ref rhs) => {
|
||||
self.check_expr_assign(expr, expected, lhs, rhs)
|
||||
|
|
|
|||
|
|
@ -2137,7 +2137,7 @@ impl Context {
|
|||
self.shared.fs.write(&final_file, &v)?;
|
||||
|
||||
// Generating settings page.
|
||||
let settings = Settings::new(self.shared.static_root_path.deref().unwrap_or("./"),
|
||||
let settings = Settings::new(self.shared.static_root_path.as_deref().unwrap_or("./"),
|
||||
&self.shared.resource_suffix);
|
||||
page.title = "Rustdoc settings";
|
||||
page.description = "Settings of Rustdoc";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref` found for type `std::option::Option<{in
|
|||
--> $DIR/option-as_deref.rs:4:29
|
||||
|
|
||||
LL | let _result = &Some(42).as_deref();
|
||||
| ^^^^^^^^ help: did you mean: `as_ref`
|
||||
| ^^^^^^^^ help: there is a method with a similar name: `as_ref`
|
||||
|
|
||||
= note: the method `as_deref` exists but the following trait bounds were not satisfied:
|
||||
`{integer} : std::ops::Deref`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref` found for type `std::result::Result<{in
|
|||
--> $DIR/result-as_deref.rs:4:27
|
||||
|
|
||||
LL | let _result = &Ok(42).as_deref();
|
||||
| ^^^^^^^^ help: did you mean: `as_ref`
|
||||
| ^^^^^^^^ help: there is a method with a similar name: `as_ref`
|
||||
|
|
||||
= note: the method `as_deref` exists but the following trait bounds were not satisfied:
|
||||
`{integer} : std::ops::Deref`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_err` found for type `std::result::Result
|
|||
--> $DIR/result-as_deref_err.rs:4:28
|
||||
|
|
||||
LL | let _result = &Err(41).as_deref_err();
|
||||
| ^^^^^^^^^^^^ help: did you mean: `as_deref_ok`
|
||||
| ^^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_ok`
|
||||
|
|
||||
= note: the method `as_deref_err` exists but the following trait bounds were not satisfied:
|
||||
`{integer} : std::ops::Deref`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut` found for type `std::result::Result
|
|||
--> $DIR/result-as_deref_mut.rs:4:31
|
||||
|
|
||||
LL | let _result = &mut Ok(42).as_deref_mut();
|
||||
| ^^^^^^^^^^^^ help: did you mean: `as_deref_err`
|
||||
| ^^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_err`
|
||||
|
|
||||
= note: the method `as_deref_mut` exists but the following trait bounds were not satisfied:
|
||||
`{integer} : std::ops::DerefMut`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut_err` found for type `std::result::Re
|
|||
--> $DIR/result-as_deref_mut_err.rs:4:32
|
||||
|
|
||||
LL | let _result = &mut Err(41).as_deref_mut_err();
|
||||
| ^^^^^^^^^^^^^^^^ help: did you mean: `as_deref_mut_ok`
|
||||
| ^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_mut_ok`
|
||||
|
|
||||
= note: the method `as_deref_mut_err` exists but the following trait bounds were not satisfied:
|
||||
`{integer} : std::ops::DerefMut`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut_ok` found for type `std::result::Res
|
|||
--> $DIR/result-as_deref_mut_ok.rs:4:31
|
||||
|
|
||||
LL | let _result = &mut Ok(42).as_deref_mut_ok();
|
||||
| ^^^^^^^^^^^^^^^ help: did you mean: `as_deref_mut_err`
|
||||
| ^^^^^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_mut_err`
|
||||
|
|
||||
= note: the method `as_deref_mut_ok` exists but the following trait bounds were not satisfied:
|
||||
`{integer} : std::ops::DerefMut`
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_ok` found for type `std::result::Result<
|
|||
--> $DIR/result-as_deref_ok.rs:4:27
|
||||
|
|
||||
LL | let _result = &Ok(42).as_deref_ok();
|
||||
| ^^^^^^^^^^^ help: did you mean: `as_deref_err`
|
||||
| ^^^^^^^^^^^ help: there is a method with a similar name: `as_deref_err`
|
||||
|
|
||||
= note: the method `as_deref_ok` exists but the following trait bounds were not satisfied:
|
||||
`{integer} : std::ops::Deref`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue