Skip to content

Commit

Permalink
Tweak docs
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Apr 6, 2024
1 parent a52c531 commit 06db6cf
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ use crate::checkers::ast::Checker;
/// `if` expression contains side effects.
///
/// For example, `foo` will be called twice in `foo() if foo() else bar()`
/// (assuming it returns a truthy value), but only once in `foo() or bar()`.
/// (assuming `foo()` returns a truthy value), but only once in
/// `foo() or bar()`.
#[violation]
pub struct IfExpInsteadOfOrOperator;

Expand Down Expand Up @@ -89,7 +90,7 @@ pub(crate) fn if_exp_instead_of_or_operator(checker: &mut Checker, if_expr: &ast
),
if_expr.range(),
),
if contains_effect(&body, |id| checker.semantic().is_builtin(id)) {
if contains_effect(body, |id| checker.semantic().is_builtin(id)) {
Applicability::Unsafe
} else {
Applicability::Safe
Expand Down

0 comments on commit 06db6cf

Please sign in to comment.