Skip to content

Commit

Permalink
Clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Virgiel committed Jan 22, 2023
1 parent 807a31f commit acb68a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cornucopia/src/read_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl From<ModuleInfo> for NamedSource {

impl From<&ModuleInfo> for NamedSource {
fn from(m: &ModuleInfo) -> Self {
Self::new(&m.path.to_string_lossy(), m.content.clone())
Self::new(m.path.to_string_lossy(), m.content.clone())
}
}

Expand Down
8 changes: 4 additions & 4 deletions integration/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn run_errors_test(
"Expected:".bright_black()
};

let original_pwd = std::env::current_dir().unwrap();
let original_pwd = &std::env::current_dir().unwrap();
for file in std::fs::read_dir("fixtures/errors")? {
let file = file?;
let name = file.file_name().to_string_lossy().to_string();
Expand All @@ -149,7 +149,7 @@ fn run_errors_test(
// Generate queries files
std::fs::create_dir("queries")?;
let name = test.query_name.unwrap_or("test.sql");
std::fs::write(&format!("queries/{name}"), test.query.unwrap_or_default())?;
std::fs::write(format!("queries/{name}"), test.query.unwrap_or_default())?;

// Run codegen
let result: Result<(), cornucopia::Error> = (|| {
Expand Down Expand Up @@ -184,7 +184,7 @@ fn run_errors_test(
if apply {
test.error = Cow::Owned(err.trim().to_string());
}
std::env::set_current_dir(&original_pwd)?;
std::env::set_current_dir(original_pwd)?;
}

if apply {
Expand Down Expand Up @@ -285,7 +285,7 @@ fn run_codegen_test(
Run::Path(path) => {
// Switch directory
std::env::set_current_dir(&original_pwd)?;
std::env::set_current_dir(&format!("../{}", path))?;
std::env::set_current_dir(format!("../{}", path))?;
true
}
};
Expand Down

0 comments on commit acb68a2

Please sign in to comment.