Skip to content

Commit 5c2f3d9

Browse files
taiki-ecramertj
authored andcommitted
Adjust Debug implementations
1 parent 1488b8a commit 5c2f3d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+464
-142
lines changed

futures-channel/src/mpsc/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ pub struct TryRecvError {
168168
}
169169

170170
impl fmt::Display for SendError {
171-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
171+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
172172
if self.is_full() {
173-
write!(fmt, "send failed because channel is full")
173+
write!(f, "send failed because channel is full")
174174
} else {
175-
write!(fmt, "send failed because receiver is gone")
175+
write!(f, "send failed because receiver is gone")
176176
}
177177
}
178178
}
@@ -198,19 +198,19 @@ impl SendError {
198198
}
199199

200200
impl<T> fmt::Debug for TrySendError<T> {
201-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
202-
fmt.debug_struct("TrySendError")
201+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
202+
f.debug_struct("TrySendError")
203203
.field("kind", &self.err.kind)
204204
.finish()
205205
}
206206
}
207207

208208
impl<T> fmt::Display for TrySendError<T> {
209-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
209+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
210210
if self.is_full() {
211-
write!(fmt, "send failed because channel is full")
211+
write!(f, "send failed because channel is full")
212212
} else {
213-
write!(fmt, "send failed because receiver is gone")
213+
write!(f, "send failed because receiver is gone")
214214
}
215215
}
216216
}
@@ -240,15 +240,15 @@ impl<T> TrySendError<T> {
240240
}
241241

242242
impl fmt::Debug for TryRecvError {
243-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
244-
fmt.debug_tuple("TryRecvError")
243+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
244+
f.debug_tuple("TryRecvError")
245245
.finish()
246246
}
247247
}
248248

249249
impl fmt::Display for TryRecvError {
250-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
251-
write!(fmt, "receiver channel is empty")
250+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
251+
write!(f, "receiver channel is empty")
252252
}
253253
}
254254

futures-channel/src/oneshot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ impl<T> Drop for Sender<T> {
382382
pub struct Canceled;
383383

384384
impl fmt::Display for Canceled {
385-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
386-
write!(fmt, "oneshot canceled")
385+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
386+
write!(f, "oneshot canceled")
387387
}
388388
}
389389

futures-core/src/task/__internal/atomic_waker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ impl Default for AtomicWaker {
313313
}
314314

315315
impl fmt::Debug for AtomicWaker {
316-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
317-
write!(fmt, "AtomicWaker")
316+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
317+
write!(f, "AtomicWaker")
318318
}
319319
}
320320

futures-util/src/compat/compat01as03.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ where
307307

308308
struct NotifyWaker(task03::Waker);
309309

310+
#[allow(missing_debug_implementations)] // false positive: this is private type
310311
#[derive(Clone)]
311312
struct WakerToHandle<'a>(&'a task03::Waker);
312313

futures-util/src/compat/executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ where Ex: Executor01<Executor01Future> + Clone + Send + 'static
6060

6161
/// Converts a futures 0.1 [`Executor`](futures_01::future::Executor) into a
6262
/// futures 0.3 [`Spawn`](futures_core::task::Spawn).
63-
#[derive(Clone)]
63+
#[derive(Debug, Clone)]
6464
pub struct Executor01As03<Ex> {
6565
executor01: Ex
6666
}

futures-util/src/compat/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//! This module is only available when the `compat` feature of this
44
//! library is activated.
55
6-
#![allow(missing_debug_implementations)]
7-
86
mod executor;
97
pub use self::executor::{Executor01CompatExt, Executor01Future, Executor01As03};
108

futures-util/src/future/flatten.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ impl<Fut> fmt::Debug for Flatten<Fut>
3131
where Fut: Future + fmt::Debug,
3232
Fut::Output: Future + fmt::Debug,
3333
{
34-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
35-
fmt.debug_struct("Flatten")
34+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
35+
f.debug_struct("Flatten")
3636
.field("state", &self.state)
3737
.finish()
3838
}

futures-util/src/future/flatten_stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ impl<Fut> fmt::Debug for FlattenStream<Fut>
2525
where Fut: Future + fmt::Debug,
2626
Fut::Output: fmt::Debug,
2727
{
28-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
29-
fmt.debug_struct("FlattenStream")
28+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
29+
f.debug_struct("FlattenStream")
3030
.field("state", &self.state)
3131
.finish()
3232
}

futures-util/src/future/join.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ macro_rules! generate {
2626
$Fut::Output: fmt::Debug,
2727
)*
2828
{
29-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
30-
fmt.debug_struct(stringify!($Join))
29+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
30+
f.debug_struct(stringify!($Join))
3131
$(.field(stringify!($Fut), &self.$Fut))*
3232
.finish()
3333
}

futures-util/src/future/join_all.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ where
7070
F: Future + fmt::Debug,
7171
F::Output: fmt::Debug,
7272
{
73-
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
74-
fmt.debug_struct("JoinAll")
73+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
74+
f.debug_struct("JoinAll")
7575
.field("elems", &self.elems)
7676
.finish()
7777
}

0 commit comments

Comments
 (0)