@@ -984,14 +984,12 @@ mod cmd {
984984
985985 let style = match args.get(0) {
986986 Some(arg) if "tabs".starts_with(&arg.to_lowercase()) => Some(Tabs),
987− Some(arg) if arg.len() == 1 => {
988− let ch = arg.chars().next().unwrap();
989− if ('1'..='8').contains(&ch) {
990− Some(Spaces(ch.to_digit(10).unwrap() as u8))
991− } else {
992− None
993− }
994− }
987+ Some(&"0") => Some(Tabs),
988+ Some(arg) => arg
989+ .parse::<u8>()
990+ .ok()
991+ .filter(|n| (1..=8).contains(n))
992+ .map(Spaces),
995993 _ => None,
996994 };
997995
@@ -1166,7 +1164,7 @@ mod cmd {
11661164 completer: None,
11671165 },
11681166 Command {
1169− name: "indent_style",
1167+ name: "indent-style",
11701168 alias: None,
11711169 doc: "Set the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.)",
11721170 fun: set_indent_style,