Skip to content

Commit

Permalink
Fix {UdpSocket,UnixDatagram}::from_std
Browse files Browse the repository at this point in the history
By adding the generic M type, which allows the caller to determine the
(un)connected mode of the socket.
  • Loading branch information
Thomasdezeeuw committed Jan 1, 2024
1 parent e2e1a76 commit abec1a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rt/src/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl<M> UdpSocket<M> {
///
/// It's up to the caller to ensure that the socket's mode is correctly set
/// to [`Connected`] or [`Unconnected`].
pub fn from_std<RT>(rt: &RT, socket: std::net::UdpSocket) -> UdpSocket
pub fn from_std<RT>(rt: &RT, socket: std::net::UdpSocket) -> UdpSocket<M>
where
RT: Access,
{
Expand Down
2 changes: 1 addition & 1 deletion rt/src/net/uds/datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl<M> UnixDatagram<M> {
///
/// It's up to the caller to ensure that the socket's mode is correctly set
/// to [`Connected`] or [`Unconnected`].
pub fn from_std<RT>(rt: &RT, socket: std::os::unix::net::UnixDatagram) -> UnixDatagram
pub fn from_std<RT>(rt: &RT, socket: std::os::unix::net::UnixDatagram) -> UnixDatagram<M>
where
RT: Access,
{
Expand Down

0 comments on commit abec1a2

Please sign in to comment.