Commit 9c1b7c3 1 parent ef5b5ae commit 9c1b7c3 Copy full SHA for 9c1b7c3
File tree 1 file changed +15
-5
lines changed
1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,6 @@ use std::{
11
11
path:: Path ,
12
12
} ;
13
13
14
- /// The format string for time fields.
15
- const TIME_FMT : & str = "%Y%m%d%H%M%S" ;
16
-
17
14
/// A single entry in the allowed signers file.
18
15
#[ derive( Debug ) ]
19
16
pub struct AllowedSigner {
@@ -23,15 +20,28 @@ pub struct AllowedSigner {
23
20
pub key : SshPublicKey ,
24
21
}
25
22
23
+ impl AllowedSigner {
24
+ /// The format string for timestamps.
25
+ const TIMESTAMP_FMT : & ' static str = "%Y%m%d%H%M%S" ;
26
+ }
27
+
26
28
impl fmt:: Display for AllowedSigner {
27
29
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
28
30
write ! ( f, "{}" , self . principal) ?;
29
31
30
32
if let Some ( valid_after) = self . valid_after {
31
- write ! ( f, " valid-after={}" , valid_after. format( TIME_FMT ) ) ?;
33
+ write ! (
34
+ f,
35
+ " valid-after={}" ,
36
+ valid_after. format( Self :: TIMESTAMP_FMT )
37
+ ) ?;
32
38
} ;
33
39
if let Some ( valid_before) = self . valid_before {
34
- write ! ( f, " valid-before={}" , valid_before. format( TIME_FMT ) ) ?;
40
+ write ! (
41
+ f,
42
+ " valid-before={}" ,
43
+ valid_before. format( Self :: TIMESTAMP_FMT )
44
+ ) ?;
35
45
} ;
36
46
37
47
write ! ( f, " {}" , self . key)
You can’t perform that action at this time.
0 commit comments