From 2f245096ffd267469151899968453b4e3bbe4a72 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 15 Feb 2024 12:48:26 +0100 Subject: [PATCH] Remove unused code --- crates/fj-core/src/layers/validation.rs | 11 ----------- crates/fj-core/src/validate/mod.rs | 5 ----- 2 files changed, 16 deletions(-) diff --git a/crates/fj-core/src/layers/validation.rs b/crates/fj-core/src/layers/validation.rs index f04d7c390..69240632c 100644 --- a/crates/fj-core/src/layers/validation.rs +++ b/crates/fj-core/src/layers/validation.rs @@ -12,17 +12,6 @@ impl Layer { pub fn take_errors(&mut self) -> Result<(), ValidationErrors> { self.process(TakeErrors, &mut Vec::new()) } - - /// Consume the validation layer, returning any validation errors - pub fn into_result(self) -> Result<(), ValidationErrors> { - let errors = self.into_state().into_errors(); - - if errors.0.is_empty() { - Ok(()) - } else { - Err(errors) - } - } } impl Command for InsertObject { diff --git a/crates/fj-core/src/validate/mod.rs b/crates/fj-core/src/validate/mod.rs index 178bf79d2..570656a07 100644 --- a/crates/fj-core/src/validate/mod.rs +++ b/crates/fj-core/src/validate/mod.rs @@ -119,11 +119,6 @@ impl Validation { let errors = HashMap::new(); Self { errors, config } } - - /// Drop this instance, returning the errors it contained - pub fn into_errors(mut self) -> ValidationErrors { - ValidationErrors(self.errors.drain().map(|(_, error)| error).collect()) - } } impl Drop for Validation {