From b3004b0db3d6c0b287c982d6bb971edf7d82c749 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Fri, 19 Jul 2024 11:35:24 +0200 Subject: [PATCH] update --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9a857f2..0e98be6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ You can derive the `Model` and `Referencable` traits for your struct. This will ```rust use serde::{Deserialize, Serialize}; -use mongod::Historic; use mongod::Validate; use mongod::Reference; use mongod::derive::{Module, Referencable}; @@ -22,8 +21,8 @@ struct MyStruct { } impl Validate for MyStruct { - async fn validate(&self) -> bool { - true + async fn validate(&self) -> Result<(), String> { + Ok(()) } } ``` @@ -86,12 +85,12 @@ struct YetAnotherStruct { } impl Validate for MyStruct { - async fn validate(&self) -> bool { + async fn validate(&self) -> Result<(), String> { if let Some(other) = self.other { assert_reference_of!(other, OtherStruct, YetAnotherStruct); } - true + Ok(()) } } ```