Skip to content

Commit 3cf1358

Browse files
committed
question_mark
1 parent 6738edc commit 3cf1358

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ suspicious = { level = "warn", priority = -1 }
159159
result_unit_err = "allow"
160160
# We don't expose public APIs that matter like this
161161
len_without_is_empty = "allow"
162-
# We currently prefer explicit control flow return over `...?;` statements whose result is unused
163-
question_mark = "allow"
164162
# We have macros that rely on this currently
165163
enum_variant_names = "allow"
166164
# Builder pattern disagrees

crates/hir/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,9 +2081,7 @@ impl Function {
20812081
}
20822082

20832083
pub fn method_params(self, db: &dyn HirDatabase) -> Option<Vec<Param>> {
2084-
if self.self_param(db).is_none() {
2085-
return None;
2086-
}
2084+
self.self_param(db)?;
20872085
Some(self.params_without_self(db))
20882086
}
20892087

crates/hir/src/semantics.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,8 @@ impl<'db> SemanticsImpl<'db> {
659659
// First expand into attribute invocations
660660
let containing_attribute_macro_call = self.with_ctx(|ctx| {
661661
token.parent_ancestors().filter_map(ast::Item::cast).find_map(|item| {
662-
if item.attrs().next().is_none() {
663-
// Don't force populate the dyn cache for items that don't have an attribute anyways
664-
return None;
665-
}
662+
// Don't force populate the dyn cache for items that don't have an attribute anyways
663+
item.attrs().next()?;
666664
Some((
667665
ctx.item_to_macro_call(InFile::new(file_id, item.clone()))?,
668666
item,

crates/ide-assists/src/handlers/convert_match_to_let_else.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub(crate) fn convert_match_to_let_else(acc: &mut Assists, ctx: &AssistContext<'
3838
let Some(ast::Expr::MatchExpr(initializer)) = let_stmt.initializer() else { return None };
3939
let initializer_expr = initializer.expr()?;
4040

41-
let Some((extracting_arm, diverging_arm)) = find_arms(ctx, &initializer) else { return None };
41+
let (extracting_arm, diverging_arm) = find_arms(ctx, &initializer)?;
4242
if extracting_arm.guard().is_some() {
4343
cov_mark::hit!(extracting_arm_has_guard);
4444
return None;

0 commit comments

Comments
 (0)