Skip to content

Commit

Permalink
TryClone for LocalSocketStream
Browse files Browse the repository at this point in the history
  • Loading branch information
kotauskas committed Jan 26, 2024
1 parent a5d1786 commit 42a7330
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/local_socket/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ multimacro! {
forward_sync_ref_rw,
forward_asinto_handle,
forward_debug,
forward_try_clone,
forward_try_from_handle(LocalSocketStreamImpl),
derive_sync_mut_rw,
derive_asintoraw,
Expand Down
10 changes: 9 additions & 1 deletion src/os/unix/local_socket/stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::name_to_addr;
use crate::{error::ReuniteError, local_socket::LocalSocketName};
use crate::{error::ReuniteError, local_socket::LocalSocketName, TryClone};
use std::{io, os::unix::net::UnixStream, sync::Arc};

#[derive(Debug)]
Expand Down Expand Up @@ -27,6 +27,14 @@ impl LocalSocketStream {
Ok(Self(inner))

Check failure on line 27 in src/os/unix/local_socket/stream.rs

View workflow job for this annotation

GitHub Actions / nightly on ubuntu-latest

mismatched types

Check failure on line 27 in src/os/unix/local_socket/stream.rs

View workflow job for this annotation

GitHub Actions / 1.70.0 on ubuntu-latest

mismatched types

Check failure on line 27 in src/os/unix/local_socket/stream.rs

View workflow job for this annotation

GitHub Actions / nightly on macos-latest

mismatched types

Check failure on line 27 in src/os/unix/local_socket/stream.rs

View workflow job for this annotation

GitHub Actions / 1.70.0 on macos-latest

mismatched types
}
}

impl TryClone for LocalSocketStream {
#[inline]
fn try_clone(&self) -> std::io::Result<Self> {
self.0.try_clone().map(Self)
}
}

multimacro! {
LocalSocketStream,
forward_rbv(UnixStream, &),
Expand Down

0 comments on commit 42a7330

Please sign in to comment.