Skip to content

Commit

Permalink
Merge pull request #35 from tecc/change/tolocalsocketname-for-localso…
Browse files Browse the repository at this point in the history
…cketname

`ToLocalSocketName` implementation for `LocalSocketName`.
  • Loading branch information
kotauskas authored Nov 20, 2023
2 parents 77f471f + c8355b4 commit de47dcd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/local_socket/to_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ pub trait ToLocalSocketName<'a> {
fn to_local_socket_name(self) -> io::Result<LocalSocketName<'a>>;
}

/// Returns self.
impl<'a> ToLocalSocketName<'a> for LocalSocketName<'a> {
fn to_local_socket_name(self) -> io::Result<LocalSocketName<'a>> {
Ok(self)
}
}

/// Converts a borrowed [`Path`] to a borrowed file-type [`LocalSocketName`] with the same lifetime.
impl<'a> ToLocalSocketName<'a> for &'a Path {
fn to_local_socket_name(self) -> io::Result<LocalSocketName<'a>> {
Expand Down

0 comments on commit de47dcd

Please sign in to comment.