Skip to content

Commit

Permalink
simplify plugin sample in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Nov 19, 2023
1 parent 07658ce commit 3f8905e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Plugins using this library.
## Example
```rust
use mackerel_plugin::*;
use rand;
use std::collections::HashMap;

struct DicePlugin {}
Expand Down Expand Up @@ -45,13 +44,9 @@ impl Plugin for DicePlugin {
}

fn main() {
let plugin = DicePlugin {};
match plugin.run() {
Ok(_) => {},
Err(err) => {
eprintln!("mackerel-plugin-dice: {}", err);
std::process::exit(1);
}
if let Err(err) = (DicePlugin {}).run() {
eprintln!("mackerel-plugin-dice: {}", err);
std::process::exit(1);
}
}
```
Expand Down

0 comments on commit 3f8905e

Please sign in to comment.