Skip to content

Commit

Permalink
Make clippy happy (#7195)
Browse files Browse the repository at this point in the history
### Description
Quick fix for a few clippy errors I was seeing in the repo.
  • Loading branch information
Zertsov committed Jan 31, 2024
1 parent 43f9e39 commit 01de08b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion crates/turborepo-fs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ mod tests {
assert!(!dst_broken_path.as_path().exists());

let dst_circle_path = dst_child_path.join_component("circle");
let dst_circle_metadata = fs::symlink_metadata(&dst_circle_path)?;
let dst_circle_metadata = fs::symlink_metadata(dst_circle_path)?;
assert!(dst_circle_metadata.is_symlink());

let num_files = fs::read_dir(dst_child_path.as_path())?.count();
Expand Down
5 changes: 1 addition & 4 deletions crates/turborepo-lib/src/turbo_json/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,7 @@ impl RawTurboJson {
#[cfg(test)]
pub fn parse_from_serde(value: serde_json::Value) -> Result<RawTurboJson, Error> {
let json_string = serde_json::to_string(&value).expect("should be able to serialize");
Self::parse(
&json_string,
&AnchoredSystemPath::new("turbo.json").unwrap(),
)
Self::parse(&json_string, AnchoredSystemPath::new("turbo.json").unwrap())
}
/// Parses a turbo.json file into the raw representation with span info
/// attached.
Expand Down
9 changes: 4 additions & 5 deletions crates/turborepo-scm/src/manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,12 @@ mod tests {
file_path.create_with_contents(contents).unwrap();
if let Some(hash) = expected_hash {
let unix_pkg_file_path = unix_path.strip_prefix(&unix_pkg_path).unwrap();
if unix_pkg_file_path.ends_with("file")
if (unix_pkg_file_path.ends_with("file")
|| unix_pkg_file_path.ends_with("package.json")
|| unix_pkg_file_path.ends_with("turbo.json")
|| unix_pkg_file_path.ends_with("turbo.json"))
&& !unix_pkg_file_path.ends_with("excluded-file")
{
if !unix_pkg_file_path.ends_with("excluded-file") {
expected.insert(unix_pkg_file_path.to_owned(), (*hash).to_owned());
}
expected.insert(unix_pkg_file_path.to_owned(), (*hash).to_owned());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-scm/src/package_deps.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, hash::Hash, str::FromStr};
use std::{collections::HashMap, str::FromStr};

use globwalk::ValidatedGlob;
use tracing::debug;
Expand Down

0 comments on commit 01de08b

Please sign in to comment.