Skip to content

Commit 369303e

Browse files
Update example
1 parent 6e141ca commit 369303e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

examples/logs.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ fn main() {
1414
let logs = vec![
1515
"<5>httpd: GET '/'",
1616
"<3>systemd: oh no !",
17-
"<7>sshd: connection inbpund",
17+
"<7>sshd: connection inbound",
18+
"invalid log entry",
19+
"<bad number>name: wow",
20+
"<",
1821
];
1922

2023
for log in logs {
21-
if let Ok(log) = log.parse::<Log>() {
22-
dbg!(log);
24+
match log.parse::<Log>() {
25+
Ok(log) => println!("{:?}", log),
26+
Err(e) => println!("{:?}", e),
2327
}
2428
}
2529
}

0 commit comments

Comments
 (0)