Skip to content

Commit

Permalink
Fixing up clippy warnings from tests in codebase (#2250)
Browse files Browse the repository at this point in the history
Ran clippy over some of our test code as a result of doing work on the
E2E tests and wanted to apply these fixes to the unit tests as well.
  • Loading branch information
jonathanrainer authored Nov 4, 2024
1 parent 2a5eb0e commit 08a5a3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/composition/supergraph/config/resolve/subgraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ mod tests {

// THEN we should receive an error that the path was unable to be resolved
let subject = assert_that!(result).is_err().subject;
let _ = if let ResolveSubgraphError::FileNotFound {
if let ResolveSubgraphError::FileNotFound {
subgraph_name: actual_subgraph_name,
supergraph_config_path: supergraph_yaml_path,
path,
Expand Down
4 changes: 2 additions & 2 deletions src/composition/watchers/watcher/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ mod tests {
.expect("Cannot open file");

writeable_file
.write("some change".as_bytes())
.write_all("some change".as_bytes())
.expect("couldn't write to file");

let mut output = None;
while let None = output {
while output.is_none() {
let _ = tokio::time::sleep(Duration::from_secs(1)).await;
output = watching.next().await;
}
Expand Down
8 changes: 4 additions & 4 deletions src/utils/supergraph_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ mod test_get_supergraph_config {
let supergraph_config_path = third_level_folder.path().join("supergraph.yaml");
fs::write(
supergraph_config_path.clone(),
&supergraph_config.into_bytes(),
supergraph_config.into_bytes(),
)
.expect("Could not write supergraph.yaml");

Expand Down Expand Up @@ -1185,7 +1185,7 @@ subgraphs:
routing_url: https://people.example.com
schema:
file: ./people.graphql"#,
latest_fed2_version.to_string()
latest_fed2_version
);
let tmp_home = TempDir::new().unwrap();
let mut config_path = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap();
Expand Down Expand Up @@ -1225,7 +1225,7 @@ subgraphs:
routing_url: https://people.example.com
schema:
file: ../../people.graphql"#,
latest_fed2_version.to_string()
latest_fed2_version
);
let tmp_home = TempDir::new().unwrap();
let tmp_dir = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap();
Expand Down Expand Up @@ -1279,7 +1279,7 @@ subgraphs:
routing_url: https://people.example.com
schema:
file: ../../people.graphql"#,
latest_fed2_version.to_string()
latest_fed2_version
);
let tmp_home = TempDir::new().unwrap();
let tmp_dir = Utf8PathBuf::try_from(tmp_home.path().to_path_buf()).unwrap();
Expand Down

0 comments on commit 08a5a3d

Please sign in to comment.