From c3012c07bc07686fab7248a9b521eebddcdaa79e Mon Sep 17 00:00:00 2001 From: Garrett Berg Date: Wed, 21 Mar 2018 17:45:04 -0600 Subject: [PATCH] add to_string and from_str methods to PathArc --- src/ser.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ser.rs b/src/ser.rs index bab515c..c1928ca 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -25,6 +25,16 @@ macro_rules! map_err { ($res: expr) => {{ }}} impl PathArc { + /// Convert the `PathArc` into an STFU8 `String`. + pub fn to_string(&self) -> String { + self.to_stfu8() + } + + /// Convert STFU8 `str` to a `PathArc`. + pub fn from_str(s: &str) -> Result { + PathArc::from_stfu8(s) + } + #[cfg(unix)] pub(crate) fn to_stfu8(&self) -> String { let bytes = self.as_os_str().as_bytes();