Skip to content

Commit 04a2e17

Browse files
author
SuperCuber
committed
Bump patch version and fix clippy
1 parent af54169 commit 04a2e17

File tree

9 files changed

+40
-40
lines changed

9 files changed

+40
-40
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dotter"
3-
version = "0.12.5"
3+
version = "0.12.6"
44
authors = ["SuperCuber <[email protected]>"]
55
description = "A dotfile manager and templater written in rust"
66
edition = "2018"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ All the files will be deployed to their target locations.
4040
Check out `dotter -h` for the command-line flags that Dotter supports:
4141

4242
```
43-
Dotter 0.12.5
43+
Dotter 0.12.6
4444
A small dotfile manager
4545
4646
USAGE:

src/actions.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ pub fn create_symlink(
256256
SymlinkComparison::OnlySourceExists => {
257257
debug!("Performing creation");
258258
fs.create_dir_all(
259-
&target
259+
target
260260
.target
261261
.parent()
262262
.context("get parent of target file")?,
263263
&target.owner,
264264
)
265265
.context("create parent for target file")?;
266-
fs.make_symlink(&target.target, &source, &target.owner)
266+
fs.make_symlink(&target.target, source, &target.owner)
267267
.context("create target symlink")?;
268268
Ok(true)
269269
}
@@ -285,7 +285,7 @@ pub fn create_symlink(
285285
);
286286
fs.remove_file(&target.target)
287287
.context("remove symlink target while forcing")?;
288-
fs.make_symlink(&target.target, &source, &target.owner)
288+
fs.make_symlink(&target.target, source, &target.owner)
289289
.context("create target symlink")?;
290290
Ok(true)
291291
}
@@ -317,22 +317,22 @@ pub fn create_template(
317317
);
318318

319319
let comparison = fs
320-
.compare_template(&target.target, &cache)
320+
.compare_template(&target.target, cache)
321321
.context("detect templated file's current state")?;
322322
debug!("Current state: {}", comparison);
323323

324324
match comparison {
325325
TemplateComparison::BothMissing => {
326326
debug!("Performing creation");
327327
fs.create_dir_all(
328-
&target
328+
target
329329
.target
330330
.parent()
331331
.context("get parent of target file")?,
332332
&target.owner,
333333
)
334334
.context("create parent for target file")?;
335-
perform_template_deploy(source, &cache, target, fs, handlebars, variables)
335+
perform_template_deploy(source, cache, target, fs, handlebars, variables)
336336
.context("perform template cache")?;
337337
Ok(true)
338338
}
@@ -342,14 +342,14 @@ pub fn create_template(
342342
source, target.target
343343
);
344344
fs.create_dir_all(
345-
&target
345+
target
346346
.target
347347
.parent()
348348
.context("get parent of target file")?,
349349
&target.owner,
350350
)
351351
.context("create parent for target file")?;
352-
perform_template_deploy(source, &cache, target, fs, handlebars, variables)
352+
perform_template_deploy(source, cache, target, fs, handlebars, variables)
353353
.context("perform template cache")?;
354354
Ok(true)
355355
}
@@ -365,14 +365,14 @@ pub fn create_template(
365365
fs.remove_file(&target.target)
366366
.context("remove existing file while forcing")?;
367367
fs.create_dir_all(
368-
&target
368+
target
369369
.target
370370
.parent()
371371
.context("get parent of target file")?,
372372
&target.owner,
373373
)
374374
.context("create parent for target file")?;
375-
perform_template_deploy(source, &cache, target, fs, handlebars, variables)
375+
perform_template_deploy(source, cache, target, fs, handlebars, variables)
376376
.context("perform template cache")?;
377377
Ok(true)
378378
}
@@ -400,7 +400,7 @@ pub fn update_symlink(
400400
debug!("Updating symlink {:?} -> {:?}...", source, target.target);
401401

402402
let comparison = fs
403-
.compare_symlink(&source, &target.target)
403+
.compare_symlink(source, &target.target)
404404
.context("detect symlink's current state")?;
405405
debug!("Current state: {}", comparison);
406406

@@ -425,7 +425,7 @@ pub fn update_symlink(
425425
);
426426
fs.remove_file(&target.target)
427427
.context("remove symlink target while forcing")?;
428-
fs.make_symlink(&target.target, &source, &target.owner)
428+
fs.make_symlink(&target.target, source, &target.owner)
429429
.context("create target symlink")?;
430430
Ok(true)
431431
}
@@ -442,14 +442,14 @@ pub fn update_symlink(
442442
source, target.target, comparison
443443
);
444444
fs.create_dir_all(
445-
&target
445+
target
446446
.target
447447
.parent()
448448
.context("get parent of target file")?,
449449
&target.owner,
450450
)
451451
.context("create parent for target file")?;
452-
fs.make_symlink(&target.target, &source, &target.owner)
452+
fs.make_symlink(&target.target, source, &target.owner)
453453
.context("create target symlink")?;
454454
Ok(true)
455455
}
@@ -470,7 +470,7 @@ pub fn update_template(
470470
) -> Result<bool> {
471471
debug!("Updating template {:?} -> {:?}...", source, target.target);
472472
let comparison = fs
473-
.compare_template(&target.target, &cache)
473+
.compare_template(&target.target, cache)
474474
.context("detect templated file's current state")?;
475475
debug!("Current state: {}", comparison);
476476

@@ -486,7 +486,7 @@ pub fn update_template(
486486
);
487487
fs.set_owner(&target.target, &target.owner)
488488
.context("set target file owner")?;
489-
perform_template_deploy(source, &cache, target, fs, handlebars, variables)
489+
perform_template_deploy(source, cache, target, fs, handlebars, variables)
490490
.context("perform template cache")?;
491491
Ok(true)
492492
}
@@ -496,14 +496,14 @@ pub fn update_template(
496496
source, target.target
497497
);
498498
fs.create_dir_all(
499-
&target
499+
target
500500
.target
501501
.parent()
502502
.context("get parent of target file")?,
503503
&target.owner,
504504
)
505505
.context("create parent for target file")?;
506-
perform_template_deploy(source, &cache, target, fs, handlebars, variables)
506+
perform_template_deploy(source, cache, target, fs, handlebars, variables)
507507
.context("perform template cache")?;
508508
Ok(true)
509509
}
@@ -529,7 +529,7 @@ pub fn update_template(
529529
);
530530
fs.remove_file(&target.target)
531531
.context("remove target while forcing")?;
532-
perform_template_deploy(source, &cache, target, fs, handlebars, variables)
532+
perform_template_deploy(source, cache, target, fs, handlebars, variables)
533533
.context("perform template cache")?;
534534
Ok(true)
535535
}
@@ -552,23 +552,23 @@ pub(crate) fn perform_template_deploy(
552552
variables: &Variables,
553553
) -> Result<()> {
554554
let file_contents = fs
555-
.read_to_string(&source)
555+
.read_to_string(source)
556556
.context("read template source file")?;
557557
let file_contents = target.apply_actions(file_contents);
558558
let rendered = handlebars
559559
.render_template(&file_contents, variables)
560560
.context("render template")?;
561561

562562
// Cache
563-
fs.create_dir_all(&cache.parent().context("get parent of cache file")?, &None)
563+
fs.create_dir_all(cache.parent().context("get parent of cache file")?, &None)
564564
.context("create parent for cache file")?;
565-
fs.write(&cache, rendered)
565+
fs.write(cache, rendered)
566566
.context("write rendered template to cache")?;
567567

568568
// Target
569-
fs.copy_file(&cache, &target.target, &target.owner)
569+
fs.copy_file(cache, &target.target, &target.owner)
570570
.context("copy template from cache to target")?;
571-
fs.copy_permissions(&source, &target.target, &target.owner)
571+
fs.copy_permissions(source, &target.target, &target.owner)
572572
.context("copy permissions from source to target")?;
573573

574574
Ok(())

src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fn merge_configuration_files(
243243
// Patch each package with included.toml's
244244
for included_path in &local.includes {
245245
|| -> Result<()> {
246-
let mut included: IncludedConfig = filesystem::load_file(&included_path)
246+
let mut included: IncludedConfig = filesystem::load_file(included_path)
247247
.and_then(|c| c.ok_or_else(|| anyhow::anyhow!("file not found")))
248248
.context("load file")?;
249249

@@ -361,9 +361,9 @@ fn merge_configuration_files(
361361
impl FileTarget {
362362
pub fn path(&self) -> &Path {
363363
match self {
364-
FileTarget::Automatic(path) => &path,
364+
FileTarget::Automatic(path) => path,
365365
FileTarget::Symbolic(SymbolicTarget { target, .. })
366-
| FileTarget::ComplexTemplate(TemplateTarget { target, .. }) => &target,
366+
| FileTarget::ComplexTemplate(TemplateTarget { target, .. }) => target,
367367
}
368368
}
369369

src/deploy.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Proceeding by copying instead of symlinking."
130130
&desired_symlinks,
131131
&desired_templates,
132132
&mut cache,
133-
&opt,
133+
opt,
134134
);
135135

136136
// === Post-deploy ===
@@ -286,7 +286,7 @@ fn run_deploy<A: ActionRunner>(
286286
existing_symlinks.difference(&desired_symlinks.keys().cloned().collect())
287287
{
288288
execute_action(
289-
runner.delete_symlink(&source, &target),
289+
runner.delete_symlink(source, target),
290290
|| resulting_cache.symlinks.remove(source),
291291
|| format!("delete symlink {:?} -> {:?}", source, target),
292292
&mut suggest_force,
@@ -298,7 +298,7 @@ fn run_deploy<A: ActionRunner>(
298298
existing_templates.difference(&desired_templates.keys().cloned().collect())
299299
{
300300
execute_action(
301-
runner.delete_template(&source, &opt.cache_directory.join(&source), &target),
301+
runner.delete_template(source, &opt.cache_directory.join(&source), target),
302302
|| resulting_cache.templates.remove(source),
303303
|| format!("delete template {:?} -> {:?}", source, target),
304304
&mut suggest_force,
@@ -316,7 +316,7 @@ fn run_deploy<A: ActionRunner>(
316316
.get(&(source.into(), target_path.into()))
317317
.unwrap();
318318
execute_action(
319-
runner.create_symlink(&source, &target),
319+
runner.create_symlink(source, target),
320320
|| {
321321
resulting_cache
322322
.symlinks
@@ -338,7 +338,7 @@ fn run_deploy<A: ActionRunner>(
338338
.get(&(source.into(), target_path.into()))
339339
.unwrap();
340340
execute_action(
341-
runner.create_template(&source, &opt.cache_directory.join(&source), &target),
341+
runner.create_template(source, &opt.cache_directory.join(&source), target),
342342
|| {
343343
resulting_cache
344344
.templates
@@ -357,7 +357,7 @@ fn run_deploy<A: ActionRunner>(
357357
.get(&(source.into(), target_path.into()))
358358
.unwrap();
359359
execute_action(
360-
runner.update_symlink(&source, &target),
360+
runner.update_symlink(source, target),
361361
|| (),
362362
|| format!("update symlink {:?} -> {:?}", source, target_path),
363363
&mut suggest_force,
@@ -372,7 +372,7 @@ fn run_deploy<A: ActionRunner>(
372372
.get(&(source.into(), target_path.into()))
373373
.unwrap();
374374
execute_action(
375-
runner.update_template(&source, &opt.cache_directory.join(&source), &target),
375+
runner.update_template(source, &opt.cache_directory.join(&source), target),
376376
|| (),
377377
|| format!("update template {:?} -> {:?}", source, target_path),
378378
&mut suggest_force,

src/difference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn print_template_diff(
1919
diff_context_lines: usize,
2020
) {
2121
if log_enabled!(log::Level::Info) {
22-
match generate_diff(source, target, handlebars, &variables) {
22+
match generate_diff(source, target, handlebars, variables) {
2323
Ok(diff) => {
2424
if diff_nonempty(&diff) {
2525
info!(

src/filesystem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ pub fn symlinks_enabled(_test_file_path: &Path) -> Result<bool> {
884884

885885
#[cfg(windows)]
886886
pub fn platform_dunce(path: &Path) -> PathBuf {
887-
dunce::simplified(&path).into()
887+
dunce::simplified(path).into()
888888
}
889889

890890
#[cfg(unix)]

src/handlebars_helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn register_rust_helpers(handlebars: &mut Handlebars<'_>) {
269269
fn register_script_helpers(handlebars: &mut Handlebars<'_>, helpers: &Helpers) {
270270
debug!("Registering script helpers...");
271271
for (helper_name, helper_path) in helpers {
272-
if let Err(e) = handlebars.register_script_helper_file(&helper_name, &helper_path) {
272+
if let Err(e) = handlebars.register_script_helper_file(helper_name, &helper_path) {
273273
warn!(
274274
"Coudln't register helper script {} at path {:?} because {}",
275275
helper_name, helper_path, e

0 commit comments

Comments
 (0)