1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Simple predefined formats for use with [`refmt()`](crate::refmt).
use fmt;
use crateFmt;
/// [`Fmt`] format type which forces a string to be unquoted inside [`fmt::Debug`].
///
/// # Example
///
/// This may be used to place arbitrary strings inside of [`fmt::Formatter`]'s debug formatting
/// helpers:
///
/// ```
/// use core::fmt;
/// use manyfmt::{Refmt, formats::Unquote};
///
/// struct Example {
/// private_key: [u8; 1024],
/// }
///
/// impl fmt::Debug for Example {
/// fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
/// fmt.debug_struct("Example")
/// .field("private_key", &"<redacted>".refmt(&Unquote))
/// .finish()
/// }
/// }
///
/// let s = Example { private_key: [0; 1024] };
/// assert_eq!(format!("{s:?}"), "Example { private_key: <redacted> }")
;