smart_debug/lib.rs
1// TODO: include compile tests to test for error messages when it fails to build. dtolnay has some
2// library for it already
3// TODO: should `debug("Blah")` be `Blah` or `"Blah"` when formatted?
4// TODO: definitely need to check error messages to make sure that the error spans for things make
5// sense
6// TODO: Get wrapper working as a container attr
7#![doc = include_str!("../README.md")]
8
9#[doc(inline)]
10pub use smart_debug_derive::SmartDebug;
11
12/// NOT PART OF THE PUBLIC API
13#[doc(hidden)]
14pub mod internal {
15 use std::fmt;
16
17 pub struct __SkippedTupleField;
18
19 impl fmt::Debug for __SkippedTupleField {
20 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
21 // Specifics of the formatting target shouldn't matter here since it's always `_`
22 write!(f, "{:?}", __LiteralField(format_args!("_")))
23 }
24 }
25
26 pub struct __LiteralField<'args>(pub fmt::Arguments<'args>);
27
28 impl fmt::Debug for __LiteralField<'_> {
29 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
30 f.write_fmt(self.0)
31 }
32 }
33}