Skip to content

Commit d42dff2

Browse files
committed
chore: clippy lints
1 parent 87b7fbf commit d42dff2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/dots.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl Dot {
8181

8282
// Single file : inject vars and write to .dots/
8383
if source.is_file() {
84-
fs::create_dir_all(&target.parent().unwrap())?;
84+
fs::create_dir_all(target.parent().unwrap())?;
8585
match vars.to_dot(source) {
8686
Ok(content) if target.exists() => self.update(source, target, content),
8787
Ok(content) => self.create(source, target, content),
@@ -127,7 +127,7 @@ impl Dot {
127127

128128
fn create(&self, source: &PathBuf, target: &PathBuf, content: String) -> Result<LinkResult> {
129129
let permissions = fs::metadata(source)?.permissions();
130-
let mut dot_copy = File::create(&target)?;
130+
let mut dot_copy = File::create(target)?;
131131
dot_copy.write_all(content.as_bytes())?;
132132
dot_copy.set_permissions(permissions)?;
133133
Ok(LinkResult::Created)

src/gpg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl Gpg {
3535
vars.insert(key, &encrypted);
3636

3737
let toml = toml::to_string(&vars.variables)?;
38-
std::fs::write(&var_file, toml)?;
38+
std::fs::write(var_file, toml)?;
3939
println!("Added {} : {}", key, value);
4040

4141
Ok(())

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ impl Bombadil {
555555
MetadataType::Path => vec![self.path.display().to_string()],
556556
MetadataType::Profiles => {
557557
let mut profiles = vec!["default".to_string()];
558-
profiles.extend(self.profiles.iter().map(|(k, _)| k.clone()));
558+
profiles.extend(self.profiles.keys().cloned());
559559
profiles
560560
}
561561
MetadataType::Vars => self

src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl BombadilState {
3939

4040
pub fn write(&self) -> Result<()> {
4141
let content = toml::to_string(&self)?;
42-
fs::write(&self.path, &content)?;
42+
fs::write(&self.path, content)?;
4343
fs::File::open(&self.path)?.sync_data()?;
4444
Ok(())
4545
}

0 commit comments

Comments
 (0)