diff --git a/README.md b/README.md index fdce553..6b2bf78 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,10 @@ Library for managing Wake-on-LAN packets. It supports: From string representation of MAC address and using defaults when broadcasting: ```rust let wol = wakey::WolPacket::from_string("01:02:03:04:05:06", ':'); -match wol.send_magic() { - Ok(_) => println!("Sent the magic packet!"), - Err(_) => println!("Failed to send the magic packet!") +if wol.send_magic().is_ok() { + println!("Sent the magic packet!"); +} else { + println!("Failed to send the magic packet!"); } ``` diff --git a/src/lib.rs b/src/lib.rs index 16aaec9..96c7e48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,9 +2,10 @@ //! # Example //! ``` //! let wol = wakey::WolPacket::from_string("01:02:03:04:05:06", ':'); -//! match wol.send_magic() { -//! Ok(_) => println!("Sent the magic packet!"), -//! Err(_) => println!("Failed to send the magic packet!") +//! if wol.send_magic().is_ok() { +//! println!("Sent the magic packet!"); +//! } else { +//! println!("Failed to send the magic packet!"); //! } //! ```