More robust as_ref/as_deref suggestions
This commit is contained in:
parent
522ae84e03
commit
af54d584b2
12 changed files with 208 additions and 153 deletions
|
@ -1246,30 +1246,6 @@ pub struct FnConsiderCasting {
|
|||
pub casting: String,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum SuggestAsRefWhereAppropriate<'a> {
|
||||
#[suggestion(
|
||||
infer_sarwa_option,
|
||||
code = "{snippet}.as_ref()",
|
||||
applicability = "machine-applicable"
|
||||
)]
|
||||
Option {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
snippet: &'a str,
|
||||
},
|
||||
#[suggestion(
|
||||
infer_sarwa_result,
|
||||
code = "{snippet}.as_ref()",
|
||||
applicability = "machine-applicable"
|
||||
)]
|
||||
Result {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
snippet: &'a str,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum SuggestAccessingField<'a> {
|
||||
#[suggestion(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue