Skip to content

Commit

Permalink
Remove unnecessary binding modifiers (#2636)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Feb 21, 2025
1 parent 7c63fb6 commit d0372d1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
16 changes: 6 additions & 10 deletions src/compile_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Display for CompileError<'_> {
}
}
BacktickShebang => write!(f, "Backticks may not start with `#!`"),
CircularRecipeDependency { recipe, ref circle } => {
CircularRecipeDependency { recipe, circle } => {
if circle.len() == 2 {
write!(f, "Recipe `{recipe}` depends on itself")
} else {
Expand All @@ -65,10 +65,7 @@ impl Display for CompileError<'_> {
)
}
}
CircularVariableDependency {
variable,
ref circle,
} => {
CircularVariableDependency { variable, circle } => {
if circle.len() == 2 {
write!(f, "Variable `{variable}` is defined in terms of itself")
} else {
Expand Down Expand Up @@ -165,7 +162,7 @@ impl Display for CompileError<'_> {
ShowWhitespace(expected),
ShowWhitespace(found)
),
Internal { ref message } => write!(
Internal { message } => write!(
f,
"Internal error, this may indicate a bug in just: {message}\n\
consider filing an issue: https://github.com/casey/just/issues/new"
Expand Down Expand Up @@ -263,10 +260,9 @@ impl Display for CompileError<'_> {
List::or_ticked(expected),
)
}
UnexpectedToken {
ref expected,
found,
} => write!(f, "Expected {}, but found {found}", List::or(expected)),
UnexpectedToken { expected, found } => {
write!(f, "Expected {}, but found {found}", List::or(expected))
}
UnicodeEscapeCharacter { character } => {
write!(f, "expected hex digit [0-9A-Fa-f] but found `{character}`")
}
Expand Down
2 changes: 1 addition & 1 deletion src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ mod tests {
}
);
assert_matches!(&*compile_error.kind,
Internal { ref message }
Internal { message }
if message == "Lexer presumed character `-`"
);

Expand Down
4 changes: 1 addition & 3 deletions src/recipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ impl<'src, D> Recipe<'src, D> {
}

pub(crate) fn confirm(&self) -> RunResult<'src, bool> {
if let Some(Attribute::Confirm(ref prompt)) =
self.attributes.get(AttributeDiscriminant::Confirm)
{
if let Some(Attribute::Confirm(prompt)) = self.attributes.get(AttributeDiscriminant::Confirm) {
if let Some(prompt) = prompt {
eprint!("{} ", prompt.cooked);
} else {
Expand Down

0 comments on commit d0372d1

Please sign in to comment.