Skip to content

Commit

Permalink
chore: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybosamiya-ms committed Jul 5, 2024
1 parent 6183c44 commit e1b7464
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,13 @@ fn to_doc<'a>(
Rule::COMMENT => {
inner = inner.append(doc);
}
rule @ _ => unreachable!("Unreachable rule {rule:?}"),
rule => unreachable!("Unreachable rule {rule:?}"),
}
}
arena.space().append(block_braces(
arena,
inner,
pairs.rev().next().unwrap().as_rule() == Rule::semi_str,
pairs.last().unwrap().as_rule() == Rule::semi_str,
))
}
Rule::calc_macro_call => map_to_doc(ctx, arena, pair),
Expand Down
8 changes: 1 addition & 7 deletions src/rustfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,14 @@ pub fn rustfmt(s: &str) -> Option<String> {
}

/// Options to pass to `rustfmt`
#[derive(Clone)]
#[derive(Clone, Default)]
pub struct RustFmtConfig {
/// If set, explicitly provides the specified `rustfmt.toml` configuration to rustfmt;
/// otherwise, uses the default behavior (i.e., picking up `rustfmt.toml` if it exists from
/// the file's directory or ancestors)
pub rustfmt_toml: Option<String>,
}

impl Default for RustFmtConfig {
fn default() -> Self {
Self { rustfmt_toml: None }
}
}

impl RustFmtConfig {
pub fn run(&self, s: &str) -> Option<String> {
rustfmt_with_config(s, self)
Expand Down

0 comments on commit e1b7464

Please sign in to comment.