question_mark
This commit is contained in:
parent
6738edc259
commit
3cf1358eb8
4 changed files with 4 additions and 10 deletions
|
@ -159,8 +159,6 @@ suspicious = { level = "warn", priority = -1 }
|
|||
result_unit_err = "allow"
|
||||
# We don't expose public APIs that matter like this
|
||||
len_without_is_empty = "allow"
|
||||
# We currently prefer explicit control flow return over `...?;` statements whose result is unused
|
||||
question_mark = "allow"
|
||||
# We have macros that rely on this currently
|
||||
enum_variant_names = "allow"
|
||||
# Builder pattern disagrees
|
||||
|
|
|
@ -2081,9 +2081,7 @@ impl Function {
|
|||
}
|
||||
|
||||
pub fn method_params(self, db: &dyn HirDatabase) -> Option<Vec<Param>> {
|
||||
if self.self_param(db).is_none() {
|
||||
return None;
|
||||
}
|
||||
self.self_param(db)?;
|
||||
Some(self.params_without_self(db))
|
||||
}
|
||||
|
||||
|
|
|
@ -659,10 +659,8 @@ impl<'db> SemanticsImpl<'db> {
|
|||
// First expand into attribute invocations
|
||||
let containing_attribute_macro_call = self.with_ctx(|ctx| {
|
||||
token.parent_ancestors().filter_map(ast::Item::cast).find_map(|item| {
|
||||
if item.attrs().next().is_none() {
|
||||
// Don't force populate the dyn cache for items that don't have an attribute anyways
|
||||
return None;
|
||||
}
|
||||
// Don't force populate the dyn cache for items that don't have an attribute anyways
|
||||
item.attrs().next()?;
|
||||
Some((
|
||||
ctx.item_to_macro_call(InFile::new(file_id, item.clone()))?,
|
||||
item,
|
||||
|
|
|
@ -38,7 +38,7 @@ pub(crate) fn convert_match_to_let_else(acc: &mut Assists, ctx: &AssistContext<'
|
|||
let Some(ast::Expr::MatchExpr(initializer)) = let_stmt.initializer() else { return None };
|
||||
let initializer_expr = initializer.expr()?;
|
||||
|
||||
let Some((extracting_arm, diverging_arm)) = find_arms(ctx, &initializer) else { return None };
|
||||
let (extracting_arm, diverging_arm) = find_arms(ctx, &initializer)?;
|
||||
if extracting_arm.guard().is_some() {
|
||||
cov_mark::hit!(extracting_arm_has_guard);
|
||||
return None;
|
||||
|
|
Loading…
Add table
Reference in a new issue