mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-09-11 16:07:00 +03:00
fix: map_err()? instead of unwrap (#3826)
This commit is contained in:
parent
800a490676
commit
16b9a1841f
@ -985,7 +985,9 @@ pub fn tree(&self) -> &Tree {
|
||||
}
|
||||
|
||||
fn parse(&mut self, parser: &mut Parser, source: &Rope) -> Result<(), Error> {
|
||||
parser.set_included_ranges(&self.ranges).unwrap();
|
||||
parser
|
||||
.set_included_ranges(&self.ranges)
|
||||
.map_err(|_| Error::InvalidRanges)?;
|
||||
|
||||
parser
|
||||
.set_language(self.config.language)
|
||||
@ -1135,6 +1137,7 @@ fn traverse(point: Point, text: &Tendril) -> Point {
|
||||
pub enum Error {
|
||||
Cancelled,
|
||||
InvalidLanguage,
|
||||
InvalidRanges,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user