@@ -256,14 +256,14 @@ pub fn create_symlink(
256
256
SymlinkComparison :: OnlySourceExists => {
257
257
debug ! ( "Performing creation" ) ;
258
258
fs. create_dir_all (
259
- & target
259
+ target
260
260
. target
261
261
. parent ( )
262
262
. context ( "get parent of target file" ) ?,
263
263
& target. owner ,
264
264
)
265
265
. context ( "create parent for target file" ) ?;
266
- fs. make_symlink ( & target. target , & source, & target. owner )
266
+ fs. make_symlink ( & target. target , source, & target. owner )
267
267
. context ( "create target symlink" ) ?;
268
268
Ok ( true )
269
269
}
@@ -285,7 +285,7 @@ pub fn create_symlink(
285
285
) ;
286
286
fs. remove_file ( & target. target )
287
287
. context ( "remove symlink target while forcing" ) ?;
288
- fs. make_symlink ( & target. target , & source, & target. owner )
288
+ fs. make_symlink ( & target. target , source, & target. owner )
289
289
. context ( "create target symlink" ) ?;
290
290
Ok ( true )
291
291
}
@@ -317,22 +317,22 @@ pub fn create_template(
317
317
) ;
318
318
319
319
let comparison = fs
320
- . compare_template ( & target. target , & cache)
320
+ . compare_template ( & target. target , cache)
321
321
. context ( "detect templated file's current state" ) ?;
322
322
debug ! ( "Current state: {}" , comparison) ;
323
323
324
324
match comparison {
325
325
TemplateComparison :: BothMissing => {
326
326
debug ! ( "Performing creation" ) ;
327
327
fs. create_dir_all (
328
- & target
328
+ target
329
329
. target
330
330
. parent ( )
331
331
. context ( "get parent of target file" ) ?,
332
332
& target. owner ,
333
333
)
334
334
. 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)
336
336
. context ( "perform template cache" ) ?;
337
337
Ok ( true )
338
338
}
@@ -342,14 +342,14 @@ pub fn create_template(
342
342
source, target. target
343
343
) ;
344
344
fs. create_dir_all (
345
- & target
345
+ target
346
346
. target
347
347
. parent ( )
348
348
. context ( "get parent of target file" ) ?,
349
349
& target. owner ,
350
350
)
351
351
. 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)
353
353
. context ( "perform template cache" ) ?;
354
354
Ok ( true )
355
355
}
@@ -365,14 +365,14 @@ pub fn create_template(
365
365
fs. remove_file ( & target. target )
366
366
. context ( "remove existing file while forcing" ) ?;
367
367
fs. create_dir_all (
368
- & target
368
+ target
369
369
. target
370
370
. parent ( )
371
371
. context ( "get parent of target file" ) ?,
372
372
& target. owner ,
373
373
)
374
374
. 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)
376
376
. context ( "perform template cache" ) ?;
377
377
Ok ( true )
378
378
}
@@ -400,7 +400,7 @@ pub fn update_symlink(
400
400
debug ! ( "Updating symlink {:?} -> {:?}..." , source, target. target) ;
401
401
402
402
let comparison = fs
403
- . compare_symlink ( & source, & target. target )
403
+ . compare_symlink ( source, & target. target )
404
404
. context ( "detect symlink's current state" ) ?;
405
405
debug ! ( "Current state: {}" , comparison) ;
406
406
@@ -425,7 +425,7 @@ pub fn update_symlink(
425
425
) ;
426
426
fs. remove_file ( & target. target )
427
427
. context ( "remove symlink target while forcing" ) ?;
428
- fs. make_symlink ( & target. target , & source, & target. owner )
428
+ fs. make_symlink ( & target. target , source, & target. owner )
429
429
. context ( "create target symlink" ) ?;
430
430
Ok ( true )
431
431
}
@@ -442,14 +442,14 @@ pub fn update_symlink(
442
442
source, target. target, comparison
443
443
) ;
444
444
fs. create_dir_all (
445
- & target
445
+ target
446
446
. target
447
447
. parent ( )
448
448
. context ( "get parent of target file" ) ?,
449
449
& target. owner ,
450
450
)
451
451
. context ( "create parent for target file" ) ?;
452
- fs. make_symlink ( & target. target , & source, & target. owner )
452
+ fs. make_symlink ( & target. target , source, & target. owner )
453
453
. context ( "create target symlink" ) ?;
454
454
Ok ( true )
455
455
}
@@ -470,7 +470,7 @@ pub fn update_template(
470
470
) -> Result < bool > {
471
471
debug ! ( "Updating template {:?} -> {:?}..." , source, target. target) ;
472
472
let comparison = fs
473
- . compare_template ( & target. target , & cache)
473
+ . compare_template ( & target. target , cache)
474
474
. context ( "detect templated file's current state" ) ?;
475
475
debug ! ( "Current state: {}" , comparison) ;
476
476
@@ -486,7 +486,7 @@ pub fn update_template(
486
486
) ;
487
487
fs. set_owner ( & target. target , & target. owner )
488
488
. 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)
490
490
. context ( "perform template cache" ) ?;
491
491
Ok ( true )
492
492
}
@@ -496,14 +496,14 @@ pub fn update_template(
496
496
source, target. target
497
497
) ;
498
498
fs. create_dir_all (
499
- & target
499
+ target
500
500
. target
501
501
. parent ( )
502
502
. context ( "get parent of target file" ) ?,
503
503
& target. owner ,
504
504
)
505
505
. 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)
507
507
. context ( "perform template cache" ) ?;
508
508
Ok ( true )
509
509
}
@@ -529,7 +529,7 @@ pub fn update_template(
529
529
) ;
530
530
fs. remove_file ( & target. target )
531
531
. 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)
533
533
. context ( "perform template cache" ) ?;
534
534
Ok ( true )
535
535
}
@@ -552,23 +552,23 @@ pub(crate) fn perform_template_deploy(
552
552
variables : & Variables ,
553
553
) -> Result < ( ) > {
554
554
let file_contents = fs
555
- . read_to_string ( & source)
555
+ . read_to_string ( source)
556
556
. context ( "read template source file" ) ?;
557
557
let file_contents = target. apply_actions ( file_contents) ;
558
558
let rendered = handlebars
559
559
. render_template ( & file_contents, variables)
560
560
. context ( "render template" ) ?;
561
561
562
562
// 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 )
564
564
. context ( "create parent for cache file" ) ?;
565
- fs. write ( & cache, rendered)
565
+ fs. write ( cache, rendered)
566
566
. context ( "write rendered template to cache" ) ?;
567
567
568
568
// Target
569
- fs. copy_file ( & cache, & target. target , & target. owner )
569
+ fs. copy_file ( cache, & target. target , & target. owner )
570
570
. 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 )
572
572
. context ( "copy permissions from source to target" ) ?;
573
573
574
574
Ok ( ( ) )
0 commit comments