diff --git a/src/lib.rs b/src/lib.rs index 1fb146a..d762b95 100644 --- a/src/lib.rs +++ b/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() })