@@ -22,13 +22,13 @@ pub enum Unexpected {
22
22
impl fmt:: Display for Unexpected {
23
23
fn fmt ( & self , f : & mut fmt:: Formatter ) -> result:: Result < ( ) , fmt:: Error > {
24
24
match * self {
25
- Unexpected :: Bool ( b) => write ! ( f, "boolean `{}`" , b ) ,
26
- Unexpected :: I64 ( i) => write ! ( f, "64-bit integer `{}`" , i ) ,
27
- Unexpected :: I128 ( i) => write ! ( f, "128-bit integer `{}`" , i ) ,
28
- Unexpected :: U64 ( i) => write ! ( f, "64-bit unsigned integer `{}`" , i ) ,
29
- Unexpected :: U128 ( i) => write ! ( f, "128-bit unsigned integer `{}`" , i ) ,
30
- Unexpected :: Float ( v) => write ! ( f, "floating point `{}`" , v ) ,
31
- Unexpected :: Str ( ref s) => write ! ( f, "string {:?}" , s ) ,
25
+ Unexpected :: Bool ( b) => write ! ( f, "boolean `{b }`" ) ,
26
+ Unexpected :: I64 ( i) => write ! ( f, "64-bit integer `{i }`" ) ,
27
+ Unexpected :: I128 ( i) => write ! ( f, "128-bit integer `{i }`" ) ,
28
+ Unexpected :: U64 ( i) => write ! ( f, "64-bit unsigned integer `{i }`" ) ,
29
+ Unexpected :: U128 ( i) => write ! ( f, "128-bit unsigned integer `{i }`" ) ,
30
+ Unexpected :: Float ( v) => write ! ( f, "floating point `{v }`" ) ,
31
+ Unexpected :: Str ( ref s) => write ! ( f, "string {s :?}" ) ,
32
32
Unexpected :: Unit => write ! ( f, "unit value" ) ,
33
33
Unexpected :: Seq => write ! ( f, "sequence" ) ,
34
34
Unexpected :: Map => write ! ( f, "map" ) ,
@@ -142,7 +142,7 @@ impl ConfigError {
142
142
} else {
143
143
""
144
144
} ;
145
- format ! ( "{}{}{}" , segment , dot , key )
145
+ format ! ( "{segment}{dot}{key}" )
146
146
} ;
147
147
match self {
148
148
Self :: Type {
@@ -168,12 +168,12 @@ impl ConfigError {
168
168
169
169
#[ must_use]
170
170
pub ( crate ) fn prepend_index ( self , idx : usize ) -> Self {
171
- self . prepend ( & format ! ( "[{}]" , idx ) , false )
171
+ self . prepend ( & format ! ( "[{idx }]" ) , false )
172
172
}
173
173
}
174
174
175
175
/// Alias for a `Result` with the error type set to `ConfigError`.
176
- pub type Result < T > = result:: Result < T , ConfigError > ;
176
+ pub ( crate ) type Result < T > = result:: Result < T , ConfigError > ;
177
177
178
178
// Forward Debug to Display for readable panic! messages
179
179
impl fmt:: Debug for ConfigError {
@@ -189,12 +189,12 @@ impl fmt::Display for ConfigError {
189
189
190
190
ConfigError :: PathParse ( ref kind) => write ! ( f, "{}" , kind. description( ) ) ,
191
191
192
- ConfigError :: Message ( ref s) => write ! ( f, "{}" , s ) ,
192
+ ConfigError :: Message ( ref s) => write ! ( f, "{s}" ) ,
193
193
194
- ConfigError :: Foreign ( ref cause) => write ! ( f, "{}" , cause ) ,
194
+ ConfigError :: Foreign ( ref cause) => write ! ( f, "{cause}" ) ,
195
195
196
196
ConfigError :: NotFound ( ref key) => {
197
- write ! ( f, "configuration property {:?} not found" , key )
197
+ write ! ( f, "configuration property {key :?} not found" )
198
198
}
199
199
200
200
ConfigError :: Type {
@@ -203,24 +203,24 @@ impl fmt::Display for ConfigError {
203
203
expected,
204
204
ref key,
205
205
} => {
206
- write ! ( f, "invalid type: {}, expected {}" , unexpected , expected ) ?;
206
+ write ! ( f, "invalid type: {unexpected }, expected {expected}" ) ?;
207
207
208
208
if let Some ( ref key) = * key {
209
- write ! ( f, " for key `{}`" , key ) ?;
209
+ write ! ( f, " for key `{key }`" ) ?;
210
210
}
211
211
212
212
if let Some ( ref origin) = * origin {
213
- write ! ( f, " in {}" , origin ) ?;
213
+ write ! ( f, " in {origin}" ) ?;
214
214
}
215
215
216
216
Ok ( ( ) )
217
217
}
218
218
219
219
ConfigError :: FileParse { ref cause, ref uri } => {
220
- write ! ( f, "{}" , cause ) ?;
220
+ write ! ( f, "{cause}" ) ?;
221
221
222
222
if let Some ( ref uri) = * uri {
223
- write ! ( f, " in {}" , uri ) ?;
223
+ write ! ( f, " in {uri}" ) ?;
224
224
}
225
225
226
226
Ok ( ( ) )
0 commit comments