MCPcopy Create free account
hub / github.com/biblius/validify / validate_input

Function validate_input

derive_tests/tests/validify.rs:155–166  ·  view source on GitHub ↗
(input: &Input)

Source from the content-addressed store, hash-verified

153}
154
155fn validate_input(input: &Input) -> Result<(), ValidationErrors> {
156 let mut errs = ValidationErrors::new();
157 if input.a.is_empty() && input.b > 2 {
158 errs.add(ValidationError::new_schema(
159 "A is empty and b is more than 2",
160 ));
161 }
162 if errs.is_empty() {
163 return Ok(());
164 }
165 Err(errs)
166}
167
168fn validate_nested(nested: &NestedInput) -> Result<(), ValidationErrors> {
169 let mut errs = ValidationErrors::new();

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected