Skip to content

Commit

Permalink
Merge #10
Browse files Browse the repository at this point in the history
10: add to_string and from_str methods to PathArc r=vitiral a=vitiral
  • Loading branch information
bors[bot] committed Mar 22, 2018
2 parents 72c767c + c3012c0 commit f388c69
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, stfu8::DecodeError> {
PathArc::from_stfu8(s)
}

#[cfg(unix)]
pub(crate) fn to_stfu8(&self) -> String {
let bytes = self.as_os_str().as_bytes();
Expand Down

0 comments on commit f388c69

Please sign in to comment.