diff --git a/fish-rust/src/parse_constants.rs b/fish-rust/src/parse_constants.rs index 9490f8cdf..f65fec561 100644 --- a/fish-rust/src/parse_constants.rs +++ b/fish-rust/src/parse_constants.rs @@ -359,7 +359,13 @@ fn keyword_from_string<'a>(s: impl Into<&'a wstr>) -> ParseKeyword { ParseKeyword::from(s) } -#[derive(Clone)] +impl Default for ParseErrorCode { + fn default() -> Self { + ParseErrorCode::none + } +} + +#[derive(Clone, Default)] pub struct ParseError { /// Text of the error. pub text: WString, @@ -370,17 +376,6 @@ pub struct ParseError { pub source_length: usize, } -impl Default for ParseError { - fn default() -> ParseError { - ParseError { - text: L!("").to_owned(), - code: ParseErrorCode::none, - source_start: 0, - source_length: 0, - } - } -} - impl ParseError { /// Return a string describing the error, suitable for presentation to the user. If /// is_interactive is true, the offending line with a caret is printed as well.