@@ -113,28 +113,26 @@ impl SecretKey {
113
113
/// little-endian hexadecimal string using the provided formatter.
114
114
///
115
115
/// This is the only method that outputs the actual secret key value, and, thus,
116
- /// should be used with extreme precaution .
116
+ /// should be used with extreme caution .
117
117
///
118
- /// # Example
118
+ /// # Examples
119
119
///
120
120
/// ```
121
121
/// # #[cfg(all(feature = "std", not(feature = "bitcoin_hashes")))] {
122
- /// use secp256k1::ONE_KEY;
123
- /// let key = ONE_KEY;
124
- /// // Normal display hides value
125
- /// assert_eq!(
126
- /// "SecretKey(#2518682f7819fb2d)",
127
- /// format!("{:?}", key)
128
- /// );
122
+ /// let key = secp256k1::ONE_KEY;
123
+ ///
124
+ /// // Normal display hides value.
125
+ /// assert_eq!("SecretKey(#2518682f7819fb2d)", format!("{:?}", key));
126
+ ///
129
127
/// // Here we explicitly display the secret value:
130
128
/// assert_eq!(
131
129
/// "0000000000000000000000000000000000000000000000000000000000000001",
132
130
/// format!("{}", key.display_secret())
133
131
/// );
132
+ /// // Also, we can explicitly display with `Debug`:
134
133
/// assert_eq!(
135
- /// "DisplaySecret(\"0000000000000000000000000000000000000000000000000000000000000001\")",
136
- /// format!("{:?}", key.display_secret())
137
- /// );
134
+ /// format!("{:?}", key.display_secret()),
135
+ /// format!("DisplaySecret(\"{}\")", key.display_secret()));
138
136
/// # }
139
137
/// ```
140
138
#[ inline]
@@ -172,6 +170,7 @@ impl KeyPair {
172
170
/// "0000000000000000000000000000000000000000000000000000000000000001",
173
171
/// format!("{}", key.display_secret())
174
172
/// );
173
+ /// // Also, we can explicitly display with `Debug`:
175
174
/// assert_eq!(
176
175
/// "DisplaySecret(\"0000000000000000000000000000000000000000000000000000000000000001\")",
177
176
/// format!("{:?}", key.display_secret())
0 commit comments