File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,7 @@ impl core::fmt::Display for ClosureReason {
176
176
f. write_str ( "Channel closed because " ) ?;
177
177
match self {
178
178
ClosureReason :: CounterpartyForceClosed { peer_msg } => {
179
- f. write_str ( "counterparty force-closed with message " ) ?;
180
- f. write_str ( & format ! ( "{}" , peer_msg) )
179
+ f. write_fmt ( format_args ! ( "counterparty force-closed with message: {}" , peer_msg) )
181
180
} ,
182
181
ClosureReason :: HolderForceClosed => f. write_str ( "user manually force-closed the channel" ) ,
183
182
ClosureReason :: CooperativeClosure => f. write_str ( "the channel was cooperatively closed" ) ,
Original file line number Diff line number Diff line change 9
9
10
10
//! Utilities for strings.
11
11
12
+ use alloc:: string:: String ;
12
13
use core:: fmt;
13
- use crate :: util:: ser:: { Writeable , Writer , Readable } ;
14
14
use crate :: io:: { self , Read } ;
15
15
use crate :: ln:: msgs;
16
+ use crate :: util:: ser:: { Writeable , Writer , Readable } ;
16
17
17
18
/// A string that displays only printable characters, replacing control characters with
18
19
/// [`core::char::REPLACEMENT_CHARACTER`].
@@ -62,7 +63,7 @@ impl Readable for SanitizedString {
62
63
}
63
64
64
65
impl fmt:: Display for SanitizedString {
65
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
66
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
66
67
PrintableString ( & self . 0 ) . fmt ( f)
67
- }
68
- }
68
+ }
69
+ }
You can’t perform that action at this time.
0 commit comments