@@ -91,8 +91,7 @@ impl fmt::Display for TiffFormatError {
91
91
} => {
92
92
write ! (
93
93
fmt,
94
- "Decompression returned different amount of bytes than expected: got {}, expected {}." ,
95
- actual_bytes, required_bytes
94
+ "Decompression returned different amount of bytes than expected: got {actual_bytes}, expected {required_bytes}."
96
95
)
97
96
}
98
97
InconsistentStripSamples {
@@ -101,37 +100,36 @@ impl fmt::Display for TiffFormatError {
101
100
} => {
102
101
write ! (
103
102
fmt,
104
- "Inconsistent elements in strip: got {}, expected {}." ,
105
- actual_samples, required_samples
103
+ "Inconsistent elements in strip: got {actual_samples}, expected {required_samples}."
106
104
)
107
105
}
108
- InvalidDimensions ( width, height) => write ! ( fmt, "Invalid dimensions: {}x{}." , width , height ) ,
106
+ InvalidDimensions ( width, height) => write ! ( fmt, "Invalid dimensions: {width }x{height }." ) ,
109
107
InvalidTag => write ! ( fmt, "Image contains invalid tag." ) ,
110
108
InvalidTagValueType ( ref tag) => {
111
- write ! ( fmt, "Tag `{:?}` did not have the expected value type." , tag )
109
+ write ! ( fmt, "Tag `{tag :?}` did not have the expected value type." )
112
110
}
113
- RequiredTagNotFound ( ref tag) => write ! ( fmt, "Required tag `{:?}` not found." , tag ) ,
111
+ RequiredTagNotFound ( ref tag) => write ! ( fmt, "Required tag `{tag :?}` not found." ) ,
114
112
UnknownPredictor ( ref predictor) => {
115
- write ! ( fmt, "Unknown predictor “{}” encountered" , predictor )
113
+ write ! ( fmt, "Unknown predictor “{predictor }” encountered" )
116
114
}
117
115
UnknownPlanarConfiguration ( ref planar_config) => {
118
- write ! ( fmt, "Unknown planar configuration “{}” encountered" , planar_config )
116
+ write ! ( fmt, "Unknown planar configuration “{planar_config }” encountered" )
119
117
}
120
- ByteExpected ( ref val) => write ! ( fmt, "Expected byte, {:?} found." , val ) ,
121
- SignedByteExpected ( ref val) => write ! ( fmt, "Expected signed byte, {:?} found." , val ) ,
122
- ShortExpected ( ref val) => write ! ( fmt, "Expected short, {:?} found." , val ) ,
123
- SignedShortExpected ( ref val) => write ! ( fmt, "Expected signed short, {:?} found." , val ) ,
118
+ ByteExpected ( ref val) => write ! ( fmt, "Expected byte, {val :?} found." ) ,
119
+ SignedByteExpected ( ref val) => write ! ( fmt, "Expected signed byte, {val :?} found." ) ,
120
+ ShortExpected ( ref val) => write ! ( fmt, "Expected short, {val :?} found." ) ,
121
+ SignedShortExpected ( ref val) => write ! ( fmt, "Expected signed short, {val :?} found." ) ,
124
122
UnsignedIntegerExpected ( ref val) => {
125
- write ! ( fmt, "Expected unsigned integer, {:?} found." , val )
123
+ write ! ( fmt, "Expected unsigned integer, {val :?} found." )
126
124
}
127
125
SignedIntegerExpected ( ref val) => {
128
- write ! ( fmt, "Expected signed integer, {:?} found." , val )
126
+ write ! ( fmt, "Expected signed integer, {val :?} found." )
129
127
}
130
- Format ( ref val) => write ! ( fmt, "Invalid format: {:?}." , val ) ,
131
- RequiredTagEmpty ( ref val) => write ! ( fmt, "Required tag {:?} was empty." , val ) ,
128
+ Format ( ref val) => write ! ( fmt, "Invalid format: {val :?}." ) ,
129
+ RequiredTagEmpty ( ref val) => write ! ( fmt, "Required tag {val :?} was empty." ) ,
132
130
StripTileTagConflict => write ! ( fmt, "File should contain either (StripByteCounts and StripOffsets) or (TileByteCounts and TileOffsets), other combination was found." ) ,
133
131
CycleInOffsets => write ! ( fmt, "File contained a cycle in the list of IFDs" ) ,
134
- JpegDecoder ( ref error) => write ! ( fmt, "{}" , error ) ,
132
+ JpegDecoder ( ref error) => write ! ( fmt, "{error}" ) ,
135
133
SamplesPerPixelIsZero => write ! ( fmt, "Samples per pixel is zero" ) ,
136
134
}
137
135
}
@@ -182,49 +180,47 @@ impl fmt::Display for TiffUnsupportedError {
182
180
// color_type
183
181
// ),
184
182
InconsistentBitsPerSample ( ref bits_per_sample) => {
185
- write ! ( fmt, "Inconsistent bits per sample: {:?}." , bits_per_sample )
183
+ write ! ( fmt, "Inconsistent bits per sample: {bits_per_sample :?}." )
186
184
}
187
185
InterpretationWithBits ( ref photometric_interpretation, ref bits_per_sample) => write ! (
188
186
fmt,
189
- "{:?} with {:?} bits per sample is unsupported" ,
190
- photometric_interpretation, bits_per_sample
187
+ "{photometric_interpretation:?} with {bits_per_sample:?} bits per sample is unsupported"
191
188
) ,
192
189
UnknownInterpretation => write ! (
193
190
fmt,
194
191
"The image is using an unknown photometric interpretation."
195
192
) ,
196
193
UnknownCompressionMethod => write ! ( fmt, "Unknown compression method." ) ,
197
194
UnsupportedCompressionMethod ( method) => {
198
- write ! ( fmt, "Compression method {:?} is unsupported" , method )
195
+ write ! ( fmt, "Compression method {method :?} is unsupported" )
199
196
}
200
197
UnsupportedPredictor ( p) => {
201
198
write ! ( fmt, "Predictor {p:?} is unsupported" )
202
199
}
203
200
UnsupportedSampleDepth ( samples) => {
204
- write ! ( fmt, "{} samples per pixel is unsupported." , samples )
201
+ write ! ( fmt, "{samples } samples per pixel is unsupported." )
205
202
}
206
203
UnsupportedSampleFormat ( ref formats) => {
207
- write ! ( fmt, "Sample format {:?} is unsupported." , formats )
204
+ write ! ( fmt, "Sample format {formats :?} is unsupported." )
208
205
}
209
206
// UnsupportedColorType(color_type) => {
210
207
// write!(fmt, "Color type {:?} is unsupported", color_type)
211
208
// }
212
209
UnsupportedBitsPerChannel ( bits) => {
213
- write ! ( fmt, "{} bits per channel not supported" , bits )
210
+ write ! ( fmt, "{bits } bits per channel not supported" )
214
211
}
215
212
UnsupportedPlanarConfig ( config) => {
216
- write ! ( fmt, "Unsupported planar configuration “{:?}”." , config )
213
+ write ! ( fmt, "Unsupported planar configuration “{config :?}”." )
217
214
}
218
215
UnsupportedDataType => write ! ( fmt, "Unsupported data type." ) ,
219
216
UnsupportedInterpretation ( interpretation) => {
220
217
write ! (
221
218
fmt,
222
- "Unsupported photometric interpretation \" {:?}\" ." ,
223
- interpretation
219
+ "Unsupported photometric interpretation \" {interpretation:?}\" ."
224
220
)
225
221
}
226
222
UnsupportedJpegFeature ( ref unsupported_feature) => {
227
- write ! ( fmt, "Unsupported JPEG feature {:?}" , unsupported_feature )
223
+ write ! ( fmt, "Unsupported JPEG feature {unsupported_feature :?}" )
228
224
}
229
225
MisalignedTileBoundaries => write ! ( fmt, "Tile rows are not aligned to byte boundaries" ) ,
230
226
}
@@ -254,7 +250,7 @@ impl fmt::Display for UsageError {
254
250
// expected, actual
255
251
// )
256
252
// }
257
- InvalidChunkIndex ( index) => write ! ( fmt, "Image chunk index ({}) requested." , index ) ,
253
+ InvalidChunkIndex ( index) => write ! ( fmt, "Image chunk index ({index }) requested." ) ,
258
254
PredictorCompressionMismatch => write ! (
259
255
fmt,
260
256
"The requested predictor is not compatible with the requested compression"
@@ -271,16 +267,15 @@ impl fmt::Display for UsageError {
271
267
impl fmt:: Display for TiffError {
272
268
fn fmt ( & self , fmt : & mut fmt:: Formatter ) -> Result < ( ) , fmt:: Error > {
273
269
match * self {
274
- TiffError :: FormatError ( ref e) => write ! ( fmt, "Format error: {}" , e ) ,
270
+ TiffError :: FormatError ( ref e) => write ! ( fmt, "Format error: {e}" ) ,
275
271
TiffError :: UnsupportedError ( ref f) => write ! (
276
272
fmt,
277
273
"The Decoder does not support the \
278
- image format `{}`",
279
- f
274
+ image format `{f}`"
280
275
) ,
281
276
TiffError :: IoError ( ref e) => e. fmt ( fmt) ,
282
277
TiffError :: IntSizeError => write ! ( fmt, "Platform or format size limits exceeded" ) ,
283
- TiffError :: UsageError ( ref e) => write ! ( fmt, "Usage error: {}" , e ) ,
278
+ TiffError :: UsageError ( ref e) => write ! ( fmt, "Usage error: {e}" ) ,
284
279
}
285
280
}
286
281
}
0 commit comments