File tree Expand file tree Collapse file tree 7 files changed +15
-29
lines changed Expand file tree Collapse file tree 7 files changed +15
-29
lines changed Original file line number Diff line number Diff line change
1
+ msrv = " 1.65.0"
Original file line number Diff line number Diff line change @@ -234,21 +234,21 @@ impl core::convert::From<::std::io::Error> for Error {
234
234
_ => ErrorKind :: Failed ,
235
235
} ;
236
236
Self {
237
- description : format ! ( "{}" , err ) ,
237
+ description : format ! ( "{err}" ) ,
238
238
kind,
239
239
}
240
240
}
241
241
}
242
242
243
243
impl core:: convert:: From < alloc:: string:: FromUtf8Error > for Error {
244
244
fn from ( err : alloc:: string:: FromUtf8Error ) -> Self {
245
- Self :: failed ( format ! ( "{}" , err ) )
245
+ Self :: failed ( format ! ( "{err}" ) )
246
246
}
247
247
}
248
248
249
249
impl core:: convert:: From < alloc:: str:: Utf8Error > for Error {
250
250
fn from ( err : alloc:: str:: Utf8Error ) -> Self {
251
- Self :: failed ( format ! ( "{}" , err ) )
251
+ Self :: failed ( format ! ( "{err}" ) )
252
252
}
253
253
}
254
254
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ where
103
103
104
104
Ok ( ( seg. as_ptr ( ) , ( seg. len ( ) / BYTES_PER_WORD ) as u32 ) )
105
105
}
106
- None => Err ( Error :: failed ( format ! ( "Invalid segment id: {}" , id ) ) ) ,
106
+ None => Err ( Error :: failed ( format ! ( "Invalid segment id: {id}" ) ) ) ,
107
107
}
108
108
}
109
109
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ impl ElementSize {
64
64
5 => Self :: EightBytes ,
65
65
6 => Self :: Pointer ,
66
66
7 => Self :: InlineComposite ,
67
- _ => panic ! ( "illegal element size: {}" , val ) ,
67
+ _ => panic ! ( "illegal element size: {val}" ) ,
68
68
}
69
69
}
70
70
}
@@ -124,7 +124,7 @@ impl WirePointerKind {
124
124
1 => Self :: List ,
125
125
2 => Self :: Far ,
126
126
3 => Self :: Other ,
127
- _ => panic ! ( "illegal element size: {}" , val ) ,
127
+ _ => panic ! ( "illegal element size: {val}" ) ,
128
128
}
129
129
}
130
130
}
@@ -2427,8 +2427,7 @@ mod wire_helpers {
2427
2427
match cap_table. extract_cap ( n) {
2428
2428
Some ( client_hook) => Ok ( client_hook) ,
2429
2429
None => Err ( Error :: failed ( format ! (
2430
- "Message contains invalid capability pointer. Index: {}" ,
2431
- n
2430
+ "Message contains invalid capability pointer. Index: {n}"
2432
2431
) ) ) ,
2433
2432
}
2434
2433
}
Original file line number Diff line number Diff line change @@ -339,15 +339,9 @@ where
339
339
let segment_count = u32:: from_le_bytes ( buf[ 0 ..4 ] . try_into ( ) . unwrap ( ) ) . wrapping_add ( 1 ) as usize ;
340
340
341
341
if segment_count >= SEGMENTS_COUNT_LIMIT {
342
- return Err ( Error :: failed ( format ! (
343
- "Too many segments: {}" ,
344
- segment_count
345
- ) ) ) ;
342
+ return Err ( Error :: failed ( format ! ( "Too many segments: {segment_count}" ) ) ) ;
346
343
} else if segment_count == 0 {
347
- return Err ( Error :: failed ( format ! (
348
- "Too few segments: {}" ,
349
- segment_count
350
- ) ) ) ;
344
+ return Err ( Error :: failed ( format ! ( "Too few segments: {segment_count}" ) ) ) ;
351
345
}
352
346
353
347
let mut segment_lengths_builder = SegmentLengthsBuilder :: with_capacity ( segment_count) ;
Original file line number Diff line number Diff line change @@ -47,8 +47,7 @@ impl<'b> NoAllocSliceSegments<'b> {
47
47
48
48
if segments_count >= SEGMENTS_COUNT_LIMIT {
49
49
return Err ( Error :: failed ( format ! (
50
- "Too many segments: {}" ,
51
- segments_count
50
+ "Too many segments: {segments_count}"
52
51
) ) ) ;
53
52
}
54
53
@@ -75,9 +74,8 @@ impl<'b> NoAllocSliceSegments<'b> {
75
74
let total_segments_length_words = total_segments_length_bytes / 8 ;
76
75
if total_segments_length_words > limit {
77
76
return Err ( Error :: failed ( format ! (
78
- "Message has {} words, which is too large. To increase the limit on the \
79
- receiving end, see capnp::message::ReaderOptions.",
80
- total_segments_length_words
77
+ "Message has {total_segments_length_words} words, which is too large. To increase the limit on the \
78
+ receiving end, see capnp::message::ReaderOptions."
81
79
) ) ) ;
82
80
}
83
81
}
Original file line number Diff line number Diff line change @@ -38,10 +38,7 @@ pub type Reader<'a> = &'a str;
38
38
pub fn new_reader ( v : & [ u8 ] ) -> Result < Reader < ' _ > > {
39
39
match str:: from_utf8 ( v) {
40
40
Ok ( v) => Ok ( v) ,
41
- Err ( e) => Err ( Error :: failed ( format ! (
42
- "Text contains non-utf8 data: {:?}" ,
43
- e
44
- ) ) ) ,
41
+ Err ( e) => Err ( Error :: failed ( format ! ( "Text contains non-utf8 data: {e:?}" ) ) ) ,
45
42
}
46
43
}
47
44
@@ -63,10 +60,7 @@ impl<'a> Builder<'a> {
63
60
pub fn new ( bytes : & mut [ u8 ] , pos : u32 ) -> Result < Builder < ' _ > > {
64
61
if pos != 0 {
65
62
if let Err ( e) = str:: from_utf8 ( bytes) {
66
- return Err ( Error :: failed ( format ! (
67
- "Text contains non-utf8 data: {:?}" ,
68
- e
69
- ) ) ) ;
63
+ return Err ( Error :: failed ( format ! ( "Text contains non-utf8 data: {e:?}" ) ) ) ;
70
64
}
71
65
}
72
66
Ok ( Builder {
You can’t perform that action at this time.
0 commit comments