Skip to content

Commit 7678f84

Browse files
committed
clippy fixes
1 parent 1f79ada commit 7678f84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/cli/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl Install {
251251
// Write to a temp file then move it to given path. Use `sudo` on unix to move
252252
// file if needed.
253253
fn update_ini_file(php_ini: &PathBuf, ext_name: &str, disable: bool) -> anyhow::Result<()> {
254-
let current_ini_content = std::fs::read_to_string(&php_ini)?;
254+
let current_ini_content = std::fs::read_to_string(php_ini)?;
255255
let mut ext_line = format!("extension={ext_name}");
256256

257257
let mut new_lines = current_ini_content.lines().collect::<Vec<_>>();
@@ -267,7 +267,7 @@ fn update_ini_file(php_ini: &PathBuf, ext_name: &str, disable: bool) -> anyhow::
267267
}
268268

269269
new_lines.push(&ext_line);
270-
write_to_file(new_lines.join("\n"), &php_ini)?;
270+
write_to_file(new_lines.join("\n"), php_ini)?;
271271
Ok(())
272272
}
273273

@@ -612,7 +612,7 @@ fn write_to_file(content: String, filepath: &PathBuf) -> anyhow::Result<()> {
612612
std::fs::write(&tempf, content)?;
613613

614614
// Now move. `rename` will overwrite existing file.
615-
if let Err(_) = std::fs::rename(&tempf, &filepath) {
615+
if std::fs::rename(&tempf, filepath).is_err() {
616616
#[cfg(unix)]
617617
{
618618
// if not successful, try with sudo on unix.

0 commit comments

Comments
 (0)