MCPcopy Create free account
hub / github.com/Keats/validator / display_struct

Function display_struct

validator/src/display_impl.rs:20–34  ·  view source on GitHub ↗
(
        fmt: &mut fmt::Formatter<'_>,
        errs: &ValidationErrors,
        path: &str,
    )

Source from the content-addressed store, hash-verified

18 path: &str,
19) -> fmt::Result {
20 fn display_struct(
21 fmt: &mut fmt::Formatter<'_>,
22 errs: &ValidationErrors,
23 path: &str,
24 ) -> fmt::Result {
25 let mut full_path = String::new();
26 write!(&mut full_path, "{}.", path)?;
27 let base_len = full_path.len();
28 for (path, err) in errs.errors() {
29 write!(&mut full_path, "{}", path)?;
30 display_errors(fmt, err, &full_path)?;
31 full_path.truncate(base_len);
32 }
33 Ok(())
34 }
35
36 match errs {
37 ValidationErrorsKind::Field(errs) => {

Callers 1

display_errorsFunction · 0.85

Calls 2

display_errorsFunction · 0.85
errorsMethod · 0.80

Tested by

no test coverage detected