mirror of
https://github.com/hannobraun/Fornjot
synced 2025-11-24 16:32:33 +00:00
Remove redundancy in Validation
This commit is contained in:
parent
e65c030472
commit
55ffa5d3a8
@ -10,7 +10,7 @@ use super::State;
|
|||||||
|
|
||||||
/// Errors that occurred while validating the objects inserted into the stores
|
/// Errors that occurred while validating the objects inserted into the stores
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Validation(pub BTreeMap<ObjectId, ValidationFailed>);
|
pub struct Validation(pub BTreeMap<ObjectId, ValidationError>);
|
||||||
|
|
||||||
impl Drop for Validation {
|
impl Drop for Validation {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
@ -22,7 +22,7 @@ impl Drop for Validation {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for event in self.0.values() {
|
for event in self.0.values() {
|
||||||
println!("{}", event.err);
|
println!("{}", event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if !thread::panicking() {
|
if !thread::panicking() {
|
||||||
@ -51,7 +51,7 @@ impl State for Validation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn evolve(&mut self, event: &Self::Event) {
|
fn evolve(&mut self, event: &Self::Event) {
|
||||||
self.0.insert(event.object.id(), event.clone());
|
self.0.insert(event.object.id(), event.err.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user