Skip to content

Commit c5e8f9e

Browse files
committed
Implement Debug when no std feature
The `Debug` implementation for secrets is feature gated on `std`, this means we cannot build cleanly with `--no-default-features`. When the `std` feature is not enabled implement a dummy version of `Debug` that just displays <secret requires std feature to display>
1 parent 889d3c1 commit c5e8f9e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/secret.rs

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ macro_rules! impl_display_secret {
4444
.finish()
4545
}
4646
}
47+
48+
#[cfg(not(feature = "std"))]
49+
impl ::core::fmt::Debug for $thing {
50+
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
51+
write!(f, "<secret requires std feature to display>")
52+
}
53+
}
4754
}
4855
}
4956

0 commit comments

Comments
 (0)