From 165df62f73f3531197cdbf4ffc06d615cf7536e2 Mon Sep 17 00:00:00 2001 From: tecc Date: Tue, 11 Apr 2023 23:31:28 +0200 Subject: [PATCH 1/2] change: ToLocalSocketName impl for LocalSocketName --- src/local_socket/to_name.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/local_socket/to_name.rs b/src/local_socket/to_name.rs index 1411db92..85e351e0 100644 --- a/src/local_socket/to_name.rs +++ b/src/local_socket/to_name.rs @@ -59,6 +59,12 @@ pub trait ToLocalSocketName<'a> { fn to_local_socket_name(self) -> io::Result>; } +impl<'a> ToLocalSocketName<'a> for LocalSocketName<'a> { + fn to_local_socket_name(self) -> io::Result> { + 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> { From c8355b4c04d2c43be1354771be6827b886c4f654 Mon Sep 17 00:00:00 2001 From: tecc Date: Tue, 11 Apr 2023 23:34:42 +0200 Subject: [PATCH 2/2] docs: Add docs for new ToLocalSocketName impl --- src/local_socket/to_name.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/local_socket/to_name.rs b/src/local_socket/to_name.rs index 85e351e0..71f28b58 100644 --- a/src/local_socket/to_name.rs +++ b/src/local_socket/to_name.rs @@ -59,6 +59,7 @@ pub trait ToLocalSocketName<'a> { fn to_local_socket_name(self) -> io::Result>; } +/// Returns self. impl<'a> ToLocalSocketName<'a> for LocalSocketName<'a> { fn to_local_socket_name(self) -> io::Result> { Ok(self)