Skip to content

Commit 1971ad8

Browse files
authored
feat: implement into_secret for secret types (#223)
1 parent b639b5d commit 1971ad8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/macros.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,20 @@ macro_rules! new_secret_type {
241241
pub fn new(s: $type) -> Self {
242242
$name(s)
243243
}
244+
244245
#[doc = $secret_doc]
245246
///
246247
/// # Security Warning
247248
///
248249
/// Leaking this value may compromise the security of the OAuth2 flow.
249250
pub fn secret(&self) -> &$type { &self.0 }
251+
252+
#[doc = $secret_doc]
253+
///
254+
/// # Security Warning
255+
///
256+
/// Leaking this value may compromise the security of the OAuth2 flow.
257+
pub fn into_secret(self) -> $type { self.0 }
250258
}
251259
impl Debug for $name {
252260
fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {

0 commit comments

Comments
 (0)