better panic message

This commit is contained in:
KitsuneCafe 2024-02-15 02:11:41 -05:00
parent 48601fc5e6
commit 4a872d3642
1 changed files with 7 additions and 3 deletions

View File

@ -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()
})