@@ -71,18 +71,15 @@ pub fn initialize(fs: Option<Filesystem>, disks: Option<Vec<String>>) -> Result<
71
71
}
72
72
) ;
73
73
74
- info ! ( "initializing ephemeral storage disks={:?}" , disks ) ;
74
+ info ! ( "initializing ephemeral storage disks={disks :?}" ) ;
75
75
// with a single disk, there is no need to create the array
76
76
let device_name = match disks. len ( ) {
77
77
1 => disks. first ( ) . expect ( "non-empty" ) . clone ( ) ,
78
78
_ => {
79
79
let scan_output = mdadm_scan ( ) ?;
80
80
// no previously configured array found, so construct a new one
81
81
if scan_output. is_empty ( ) {
82
- info ! (
83
- "creating array named {:?} from {:?}" ,
84
- RAID_DEVICE_NAME , disks
85
- ) ;
82
+ info ! ( "creating array named {RAID_DEVICE_NAME:?} from {disks:?}" ) ;
86
83
mdadm_create ( RAID_DEVICE_NAME , disks. iter ( ) . map ( |x| x. as_str ( ) ) . collect ( ) ) ?;
87
84
}
88
85
// Once it is built, it will be available in `/dev/md/`
@@ -92,13 +89,10 @@ pub fn initialize(fs: Option<Filesystem>, disks: Option<Vec<String>>) -> Result<
92
89
93
90
let fs = fs. unwrap_or ( Filesystem :: Xfs ) ;
94
91
if !is_formatted ( & device_name, & fs) ? {
95
- info ! ( "formatting {:?} as {}" , device_name , fs ) ;
92
+ info ! ( "formatting {device_name :?} as {fs}" ) ;
96
93
format_device ( & device_name, & fs) ?;
97
94
} else {
98
- info ! (
99
- "{:?} is already formatted as {}, skipping format" ,
100
- device_name, fs
101
- ) ;
95
+ info ! ( "{device_name:?} is already formatted as {fs}, skipping format" ) ;
102
96
}
103
97
104
98
Ok ( ( ) )
@@ -158,7 +152,7 @@ pub fn bind(variant: &str, dirs: Vec<String>) -> Result<()> {
158
152
}
159
153
std:: fs:: create_dir_all ( mount_point) . context ( error:: MkdirSnafu { } ) ?;
160
154
161
- info ! ( "mounting {:?} as {:?}" , device_name , mount_point ) ;
155
+ info ! ( "mounting {device_name :?} as {mount_point :?}" ) ;
162
156
let output = Command :: new ( MOUNT )
163
157
. args ( [
164
158
OsString :: from ( device_name. clone ( ) ) ,
@@ -188,13 +182,13 @@ pub fn bind(variant: &str, dirs: Vec<String>) -> Result<()> {
188
182
std:: fs:: create_dir_all ( & mount_destination) . context ( error:: MkdirSnafu { } ) ?;
189
183
190
184
if is_mounted ( dir) ? {
191
- info ! ( "skipping bind mount of {:?}, already mounted" , dir ) ;
185
+ info ! ( "skipping bind mount of {dir :?}, already mounted" ) ;
192
186
continue ;
193
187
}
194
188
// call the equivalent of
195
189
// mount --rbind /mnt/.ephemeral/._var_lib_kubelet /var/lib/kubelet
196
190
let source_dir = OsString :: from ( & dir) ;
197
- info ! ( "binding {:?} to {:?}" , source_dir , mount_destination ) ;
191
+ info ! ( "binding {source_dir :?} to {mount_destination :?}" ) ;
198
192
199
193
let output = Command :: new ( MOUNT )
200
194
. args ( [
@@ -216,7 +210,7 @@ pub fn bind(variant: &str, dirs: Vec<String>) -> Result<()> {
216
210
217
211
for dir in dirs {
218
212
let source_dir = OsString :: from ( & dir) ;
219
- info ! ( "sharing mounts for {:?}" , source_dir ) ;
213
+ info ! ( "sharing mounts for {source_dir :?}" ) ;
220
214
// mount --make-rshared /var/lib/kubelet
221
215
let output = Command :: new ( MOUNT )
222
216
. args ( [ OsStr :: new ( "--make-rshared" ) , & source_dir] )
0 commit comments