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 {
|
fn deref(&self) -> &Self::Target {
|
||||||
match self {
|
match self {
|
||||||
Self::Owned(v) => &v,
|
Self::Owned(v) => v,
|
||||||
Self::Borrowed(v) => v
|
Self::Borrowed(v) => v,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,11 @@ impl<'a> Parse for SyntectParser<'a> {
|
||||||
&captures[2],
|
&captures[2],
|
||||||
&self.syntax_set,
|
&self.syntax_set,
|
||||||
&syntax,
|
&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()
|
.unwrap()
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue