mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04: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