better panic message

This commit is contained in:
KitsuneCafe 2024-02-15 02:11:41 -05:00
parent 48601fc5e6
commit 4a872d3642

View file

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