Skip to content

Commit bed9313

Browse files
jhprattSergioBenitez
authored andcommitted
Abide by formatting in 'Debug' implementations.
1 parent e3c1a4a commit bed9313

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

core/http/src/cookies.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ impl Cookies<'_> {
403403
impl fmt::Debug for Cookies<'_> {
404404
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
405405
match *self {
406-
Cookies::Jarred(ref jar, _) => write!(f, "{:?}", jar),
407-
Cookies::Empty(ref jar) => write!(f, "{:?}", jar)
406+
Cookies::Jarred(ref jar, _) => jar.fmt(f),
407+
Cookies::Empty(ref jar) => jar.fmt(f)
408408
}
409409
}
410410
}

core/lib/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl fmt::Debug for LaunchError {
154154
#[inline]
155155
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
156156
self.mark_handled();
157-
write!(f, "{:?}", self.kind())
157+
self.kind().fmt(f)
158158
}
159159
}
160160

core/lib/src/response/response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ impl fmt::Debug for Response<'_> {
11851185
}
11861186

11871187
match self.body {
1188-
Some(ref body) => writeln!(f, "{:?}", body),
1188+
Some(ref body) => body.fmt(f),
11891189
None => writeln!(f, "Empty Body")
11901190
}
11911191
}

core/lib/src/response/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<T: Read> Stream<T> {
3636

3737
impl<T: Read + Debug> Debug for Stream<T> {
3838
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
39-
write!(f, "Stream({:?})", self.0)
39+
f.debug_tuple("Stream").field(&self.0).finish()
4040
}
4141
}
4242

0 commit comments

Comments
 (0)