1
1
//! Types and functions to interact with the OpenSSH `allowed_signers` file.
2
2
//!
3
- //! # File format
4
- //! https://man.openbsd.org/ssh-keygen.1#ALLOWED_SIGNERS
3
+ //! [File Format Documentation](https://man.openbsd.org/ssh-keygen.1#ALLOWED_SIGNERS)
5
4
use crate :: SshPublicKey ;
6
5
use chrono:: { DateTime , Local } ;
7
6
use std:: {
@@ -81,7 +80,7 @@ impl AllowedSignersFile {
81
80
pub fn write ( & mut self ) -> io:: Result < ( ) > {
82
81
let mut file_buf = io:: BufWriter :: new ( & mut self . file ) ;
83
82
for signer in & self . signers {
84
- writeln ! ( file_buf, "{}" , signer ) ?;
83
+ writeln ! ( file_buf, "{signer}" ) ?;
85
84
}
86
85
writeln ! ( file_buf) ?;
87
86
Ok ( ( ) )
@@ -158,7 +157,7 @@ mod tests {
158
157
let path = tempfile:: NamedTempFile :: new ( ) . unwrap ( ) . into_temp_path ( ) ;
159
158
let mut expected_content = String :: new ( ) ;
160
159
for signer in & example_signers {
161
- expected_content. push_str ( & format ! ( "{}\n " , signer ) ) ;
160
+ expected_content. push_str ( & format ! ( "{signer }\n " ) ) ;
162
161
}
163
162
expected_content. push ( '\n' ) ;
164
163
@@ -175,7 +174,7 @@ mod tests {
175
174
fn writing_overrides_existing_content ( example_signers : Vec < AllowedSigner > ) {
176
175
let existing_content = "gathered dust" ;
177
176
let mut existing_file = tempfile:: NamedTempFile :: new ( ) . unwrap ( ) ;
178
- writeln ! ( existing_file, "{}" , existing_content ) . unwrap ( ) ;
177
+ writeln ! ( existing_file, "{existing_content}" ) . unwrap ( ) ;
179
178
let path = existing_file. into_temp_path ( ) ;
180
179
181
180
{
0 commit comments