@@ -14,6 +14,7 @@ use crate::{
1414} ;
1515
1616/// Implements a value without any constraints, i.e. a any value.
17+ #[ derive( Copy , Clone ) ]
1718pub struct Any < T : Validate = validate:: All > {
1819 /// The key of the value in the git configuration.
1920 pub name : & ' static str ,
@@ -148,7 +149,7 @@ impl<T: Validate> Key for Any<T> {
148149 }
149150}
150151
151- impl < T : Validate > gix_config:: AsKey for Any < T > {
152+ impl < T : Validate + Copy + Clone > gix_config:: AsKey for Any < T > {
152153 fn as_key ( & self ) -> gix_config:: KeyRef < ' _ > {
153154 self . try_as_key ( ) . expect ( "infallible" )
154155 }
@@ -512,7 +513,7 @@ pub mod validate {
512513 } ;
513514
514515 /// Everything is valid.
515- #[ derive( Default ) ]
516+ #[ derive( Default , Copy , Clone ) ]
516517 pub struct All ;
517518
518519 impl Validate for All {
@@ -522,7 +523,7 @@ pub mod validate {
522523 }
523524
524525 /// Assure that values that parse as git dates are valid.
525- #[ derive( Default ) ]
526+ #[ derive( Default , Clone , Copy ) ]
526527 pub struct Time ;
527528
528529 impl Validate for Time {
@@ -534,7 +535,7 @@ pub mod validate {
534535 }
535536
536537 /// Assure that values that parse as unsigned integers are valid.
537- #[ derive( Default ) ]
538+ #[ derive( Default , Clone , Copy ) ]
538539 pub struct UnsignedInteger ;
539540
540541 impl Validate for UnsignedInteger {
@@ -550,7 +551,7 @@ pub mod validate {
550551 }
551552
552553 /// Assure that values that parse as git booleans are valid.
553- #[ derive( Default ) ]
554+ #[ derive( Default , Clone , Copy ) ]
554555 pub struct Boolean ;
555556
556557 impl Validate for Boolean {
@@ -561,7 +562,7 @@ pub mod validate {
561562 }
562563
563564 /// Values that are git remotes, symbolic or urls
564- #[ derive( Default ) ]
565+ #[ derive( Default , Clone , Copy ) ]
565566 pub struct RemoteName ;
566567 impl Validate for RemoteName {
567568 fn validate ( & self , value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -572,7 +573,7 @@ pub mod validate {
572573 }
573574
574575 /// Values that are programs - everything is allowed.
575- #[ derive( Default ) ]
576+ #[ derive( Default , Clone , Copy ) ]
576577 pub struct Program ;
577578 impl Validate for Program {
578579 fn validate ( & self , _value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -581,7 +582,7 @@ pub mod validate {
581582 }
582583
583584 /// Values that are programs executables, everything is allowed.
584- #[ derive( Default ) ]
585+ #[ derive( Default , Clone , Copy ) ]
585586 pub struct Executable ;
586587 impl Validate for Executable {
587588 fn validate ( & self , _value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -590,7 +591,7 @@ pub mod validate {
590591 }
591592
592593 /// Values that parse as URLs.
593- #[ derive( Default ) ]
594+ #[ derive( Default , Clone , Copy ) ]
594595 pub struct Url ;
595596 impl Validate for Url {
596597 fn validate ( & self , value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -600,7 +601,7 @@ pub mod validate {
600601 }
601602
602603 /// Values that parse as ref-specs for pushing.
603- #[ derive( Default ) ]
604+ #[ derive( Default , Clone , Copy ) ]
604605 pub struct PushRefSpec ;
605606 impl Validate for PushRefSpec {
606607 fn validate ( & self , value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -610,7 +611,7 @@ pub mod validate {
610611 }
611612
612613 /// Values that parse as ref-specs for pushing.
613- #[ derive( Default ) ]
614+ #[ derive( Default , Clone , Copy ) ]
614615 pub struct FetchRefSpec ;
615616 impl Validate for FetchRefSpec {
616617 fn validate ( & self , value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -620,6 +621,7 @@ pub mod validate {
620621 }
621622
622623 /// Timeouts used for file locks.
624+ #[ derive( Clone , Copy ) ]
623625 pub struct LockTimeout ;
624626 impl Validate for LockTimeout {
625627 fn validate ( & self , value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -632,6 +634,7 @@ pub mod validate {
632634 }
633635
634636 /// Durations in milliseconds.
637+ #[ derive( Clone , Copy ) ]
635638 pub struct DurationInMilliseconds ;
636639 impl Validate for DurationInMilliseconds {
637640 fn validate ( & self , value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -644,6 +647,7 @@ pub mod validate {
644647 }
645648
646649 /// A UTF-8 string.
650+ #[ derive( Clone , Copy ) ]
647651 pub struct String ;
648652 impl Validate for String {
649653 fn validate ( & self , value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
@@ -653,6 +657,7 @@ pub mod validate {
653657 }
654658
655659 /// Any path - everything is allowed.
660+ #[ derive( Clone , Copy ) ]
656661 pub struct Path ;
657662 impl Validate for Path {
658663 fn validate ( & self , _value : & BStr ) -> Result < ( ) , Box < dyn std:: error:: Error + Send + Sync + ' static > > {
0 commit comments