Skip to content

Commit ca7e54b

Browse files
fpagliughiasomers
andauthored
Update src/sys/socket/mod.rs
Co-authored-by: Alan Somers <[email protected]>
1 parent c95b007 commit ca7e54b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/sys/socket/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,14 @@ pub enum SockProtocol {
234234
CanRaw = libc::CAN_RAW,
235235
}
236236

237-
/// The Controller Area Network broadcast manager protocol
238-
/// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
239-
#[cfg(target_os = "linux")]
240-
#[cfg_attr(docsrs, doc(cfg(all())))]
241-
#[allow(non_upper_case_globals)]
242-
pub const CanBcm: SockProtocol = SockProtocol::NetlinkUserSock; // Matches libc::CAN_BCM
243-
237+
impl SockProtocol {
238+
/// The Controller Area Network broadcast manager protocol
239+
/// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
240+
#[cfg(target_os = "linux")]
241+
#[cfg_attr(docsrs, doc(cfg(all())))]
242+
#[allow(non_upper_case_globals)]
243+
pub const CanBcm: SockProtocol = SockProtocol::NetlinkUserSock; // Matches libc::CAN_BCM
244+
}
244245
#[cfg(any(target_os = "linux"))]
245246
libc_bitflags! {
246247
/// Configuration flags for `SO_TIMESTAMPING` interface

0 commit comments

Comments
 (0)