pkstrings: Allow consuming and converting to String

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-11-14 01:45:43 +01:00
parent a82d73122d
commit 19b0f3989e

View file

@ -102,6 +102,12 @@ impl fmt::Display for Error {
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Debug, Clone, Eq, PartialEq)]
pub struct PKString(String); pub struct PKString(String);
impl PKString {
pub fn into_string(self) -> String {
self.0
}
}
impl Deref for PKString { impl Deref for PKString {
type Target = String; type Target = String;