Skip to content

Commit 702cef5

Browse files
phrohdohangered-ghandi
authored andcommitted
Use value_t instead of parse::<u32> (#62)
1 parent 4f61465 commit 702cef5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tools/slp_viewer/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ extern crate open_aoe_slp as slp;
2424
extern crate open_aoe_palette as palette;
2525

2626
extern crate minifb;
27+
28+
#[macro_use(value_t)]
2729
extern crate clap;
2830

2931
use clap::{App, Arg};
@@ -113,7 +115,7 @@ fn main() {
113115
.index(1))
114116
.get_matches();
115117

116-
let slp_id = matches.value_of("SLP").unwrap().parse::<u32>().expect("valid SLP ID");
118+
let slp_id = value_t!(matches, "SLP", u32).expect("valid SLP ID");
117119
let drs_name = matches.value_of("DRS").unwrap_or("game/data/graphics.drs");
118120
let interfac_name = matches.value_of("INTERFAC").unwrap_or("game/data/interfac.drs");
119121
let mut player_index = matches.value_of("PLAYER")

0 commit comments

Comments
 (0)