feat: cleanup aggregate error for single error
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-07-24 22:18:45 +02:00
parent a16bee8e37
commit 5da3c83c12
2 changed files with 9 additions and 1 deletions

View File

@@ -49,6 +49,14 @@ impl AggregateError {
impl Display for AggregateError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if self.errors.is_empty() {
return Ok(());
}
if self.errors.len() == 1 {
return f.write_str(&self.errors.first().unwrap().to_string());
}
f.write_str("MadError::AggregateError: (")?;
for error in &self.errors {