Skip to content

Commit 43fcda3

Browse files
committed
fix: use of undeclared crate or module lexopt
1 parent b993b7b commit 43fcda3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/cli.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ impl Cli {
4949
option: Some("layout".into()),
5050
});
5151
};
52-
c.settings.layout = Layout::from_str(l)?;
52+
c.settings.layout =
53+
Layout::from_str(l).map_err(|_| lexopt::Error::UnexpectedValue {
54+
option: "layout".into(),
55+
value: l.into(),
56+
})?;
5357
}
5458
Short('M') | Long("no-modeline") => c.modeline = false,
5559
Short('f') | Long("prefix-func") => c.settings.prefix_func = true,

src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub enum Layout {
3434
}
3535

3636
impl FromStr for Layout {
37-
type Err = lexopt::Error;
37+
type Err = ();
3838
fn from_str(s: &str) -> Result<Self, Self::Err> {
3939
match s {
4040
"default" => Ok(Self::Default),
@@ -47,10 +47,7 @@ impl FromStr for Layout {
4747
(Some("mini"), n) => {
4848
Ok(Self::Mini(n.map_or(0, |x| x.parse().unwrap_or_default())))
4949
}
50-
_ => Err(lexopt::Error::UnexpectedValue {
51-
option: "layout".into(),
52-
value: x.into(),
53-
}),
50+
_ => Err(()),
5451
}
5552
}
5653
}

0 commit comments

Comments
 (0)