impl Display for ComileErrors

This commit is contained in:
Shunsuke Shibayama 2022-11-17 20:48:42 +09:00
parent 666ec1c7fe
commit d8e2ece224
3 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,4 @@
use std::fmt;
use std::fmt::Display;
use erg_common::astr::AtomicStr;
@ -1814,6 +1815,12 @@ impl From<CompileError> for CompileErrors {
impl MultiErrorDisplay<CompileError> for CompileErrors {}
impl fmt::Display for CompileErrors {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.fmt_all(f)
}
}
impl CompileErrors {
pub fn flush(&mut self) -> Self {
Self(self.0.drain(..).collect())