better panic message
This commit is contained in:
parent
48601fc5e6
commit
4a872d3642
10
src/lib.rs
10
src/lib.rs
|
@ -23,8 +23,8 @@ impl<'a, T> Deref for MaybeOwned<'a, T> {
|
|||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
match self {
|
||||
Self::Owned(v) => &v,
|
||||
Self::Borrowed(v) => v
|
||||
Self::Owned(v) => v,
|
||||
Self::Borrowed(v) => v,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,7 +93,11 @@ impl<'a> Parse for SyntectParser<'a> {
|
|||
&captures[2],
|
||||
&self.syntax_set,
|
||||
&syntax,
|
||||
&self.theme_set.themes[self.theme],
|
||||
&self
|
||||
.theme_set
|
||||
.themes
|
||||
.get(self.theme)
|
||||
.expect(format!("couldn't find theme \"{}\"", self.theme).as_str()),
|
||||
)
|
||||
.unwrap()
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue