Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
clippy and format
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Apr 27, 2023
1 parent 06e5a84 commit 95db693
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 156 deletions.
6 changes: 3 additions & 3 deletions crates/rome_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ fn main() -> ExitCode {
}
}
Err(failure) => {
if let ParseFailure::Stdout(help) = &failure {
return if let ParseFailure::Stdout(help) = &failure {
console.log(markup! {{help}});
return ExitCode::SUCCESS;
ExitCode::SUCCESS
} else {
let diagnostic = CliDiagnostic::parse_error_bpaf(failure);
console.error(markup! { {PrintDiagnostic::simple(&diagnostic)}});
return ExitCode::FAILURE;
ExitCode::FAILURE
}
}
}
Expand Down
21 changes: 9 additions & 12 deletions crates/rome_cli/tests/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ fn fs_error_dereferenced_symlink() {

#[allow(unused_must_use)]
{
remove_dir_all(root_path.clone().display().to_string().as_str());
remove_dir_all(root_path.display().to_string().as_str());
}
create_dir(root_path.clone().display().to_string().as_str()).unwrap();
create_dir(root_path.display().to_string().as_str()).unwrap();
create_dir(subdir_path).unwrap();

#[cfg(target_family = "unix")]
Expand All @@ -793,7 +793,7 @@ fn fs_error_dereferenced_symlink() {
let result = run_cli(
DynRef::Owned(Box::new(OsFileSystem)),
&mut console,
Args::from(&[("check"), root_path.clone().display().to_string().as_str()]),
Args::from(&[("check"), root_path.display().to_string().as_str()]),
);

remove_dir_all(root_path).unwrap();
Expand All @@ -820,9 +820,9 @@ fn fs_error_infinite_symlink_exapansion() {

#[allow(unused_must_use)]
{
remove_dir_all(root_path.clone().display().to_string().as_str());
remove_dir_all(root_path.display().to_string().as_str());
}
create_dir(root_path.clone().display().to_string().as_str()).unwrap();
create_dir(root_path.display().to_string().as_str()).unwrap();
create_dir(subdir1_path.clone()).unwrap();

create_dir_all(subdir2_path.clone()).unwrap();
Expand All @@ -848,10 +848,7 @@ fn fs_error_infinite_symlink_exapansion() {
let result = run_cli(
DynRef::Owned(Box::new(OsFileSystem)),
&mut console,
Args::from(&[
("check"),
(root_path.clone().display().to_string().as_str()),
]),
Args::from(&[("check"), (root_path.display().to_string().as_str())]),
);

remove_dir_all(root_path).unwrap();
Expand Down Expand Up @@ -958,9 +955,9 @@ fn fs_files_ignore_symlink() {

#[allow(unused_must_use)]
{
remove_dir_all(root_path.clone().display().to_string().as_str());
remove_dir_all(root_path.display().to_string().as_str());
}
create_dir(root_path.clone().display().to_string().as_str()).unwrap();
create_dir(root_path.display().to_string().as_str()).unwrap();
create_dir(src_path.clone()).unwrap();
create_dir_all(testcase1_sub_path.clone()).unwrap();
create_dir(testcase2_path.clone()).unwrap();
Expand Down Expand Up @@ -1017,7 +1014,7 @@ fn fs_files_ignore_symlink() {
Args::from(&[
("check"),
("--config-path"),
(root_path.clone().display().to_string().as_str()),
(root_path.display().to_string().as_str()),
("--apply-unsafe"),
(src_path.display().to_string().as_str()),
]),
Expand Down
Loading

0 comments on commit 95db693

Please sign in to comment.