no need for match

This commit is contained in:
lesnyrumcajs 2020-03-16 22:09:49 +01:00
parent 922d7326df
commit b3e2fd8c82
2 changed files with 8 additions and 6 deletions

View File

@ -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!");
}
```

View File

@ -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!");
//! }
//! ```