Skip to content

Commit 50a67c5

Browse files
committed
Fix dccp_available_ccids example
1 parent 6ba8141 commit 50a67c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/sys/unix.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,10 +2199,14 @@ impl crate::Socket {
21992199
///
22002200
/// The API should be used in the follow way:
22012201
///
2202-
/// ```
2202+
/// ```no_run
2203+
/// # fn main() -> std::io::Result<()> {
2204+
/// use socket2::{Socket, Domain, Type, Protocol};
22032205
/// let socket = Socket::new(Domain::IPV4, Type::DCCP, Some(Protocol::DCCP))?;
2204-
/// let (endpoints_array, len) = socket.dccp_available_ccids::<4>();
2206+
/// let (endpoints_array, len) = socket.dccp_available_ccids::<4>()?;
22052207
/// let endpoints = &endpoints_array[..len];
2208+
/// # drop(endpoints);
2209+
/// # Ok(()) }
22062210
/// ```
22072211
///
22082212
/// [documentation]: https://www.kernel.org/doc/html/latest/networking/dccp.html

0 commit comments

Comments
 (0)