chore(tazjin/rlox): Add From<Error> for Vec<Error>
This makes it easier to transition between the single/multi error functions via ? Change-Id: Ie027f4700da463a549be6f0d4a0022a9b8dc0d61 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2555 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
parent
75750ba683
commit
da2dfb42c6
1 changed files with 8 additions and 0 deletions
|
@ -37,4 +37,12 @@ impl From<ScannerError> for Error {
|
|||
}
|
||||
}
|
||||
|
||||
// Convenience implementation as we're often dealing with vectors of
|
||||
// errors (to report as many issues as possible before terminating)
|
||||
impl From<Error> for Vec<Error> {
|
||||
fn from(err: Error) -> Self {
|
||||
vec![err]
|
||||
}
|
||||
}
|
||||
|
||||
pub type LoxResult<T> = Result<T, Error>;
|
||||
|
|
Loading…
Reference in a new issue