Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Oct 19, 2024
1 parent 4fc090b commit d14dca0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ imports_granularity = "Crate"
newline_style = "Unix"
use_small_heuristics = "Max"
version = "Two"
fn_single_line =true
fn_single_line = true
max_width = 90
group_imports = "StdExternalCrate"
group_imports = "StdExternalCrate"
2 changes: 1 addition & 1 deletion src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ mod test {

use similar_asserts::assert_eq;

use super::{fmt_toml, Config, Document};
use super::{Config, Document, fmt_toml};

#[test]
fn toml_fmt_check() {
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use std::{
borrow::Cow,
env,
fmt::Display,
fs::{read_to_string, OpenOptions},
fs::{OpenOptions, read_to_string},
io::Write,
path::{Path, PathBuf},
};

use clap::{
crate_authors, crate_name, crate_version, parser::ValueSource, Arg, ArgAction,
ArgMatches, Command,
Arg, ArgAction, ArgMatches, Command, crate_authors, crate_name, crate_version,
parser::ValueSource,
};
use fmt::Config;
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
Expand Down
19 changes: 7 additions & 12 deletions src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,13 @@ mod test {
#[test]
fn reorder() {
let input = fs::read_to_string("examp/clippy.toml").unwrap();
let sorted = super::sort_toml(
&input,
MATCHER,
true,
&[
"package".to_owned(),
"features".to_owned(),
"dependencies".to_owned(),
"build-dependencies".to_owned(),
"dev-dependencies".to_owned(),
],
);
let sorted = super::sort_toml(&input, MATCHER, true, &[
"package".to_owned(),
"features".to_owned(),
"dependencies".to_owned(),
"build-dependencies".to_owned(),
"dev-dependencies".to_owned(),
]);
assert_ne!(input, sorted.to_string());
}
}

0 comments on commit d14dca0

Please sign in to comment.