path-to-error

Find out path at which a deserialization error occurred

APACHE-2.0 License

Downloads
37.3M
Stars
320
Committers
7
path-to-error - Latest Release

Published by dtolnay 8 months ago

  • Implement Display for Segment (#29, thanks @noib3)
path-to-error -

Published by dtolnay 10 months ago

  • Update proc-macro2 to fix caching issue when using a rustc-wrapper such as sccache
path-to-error -

Published by dtolnay over 1 year ago

  • Documentation improvements
path-to-error -

Published by dtolnay over 1 year ago

path-to-error -

Published by dtolnay over 1 year ago

  • Support non-string keys in maps (#24)
path-to-error -

Published by dtolnay over 1 year ago

  • Implement extra iterator traits for Segments (#23, thanks @swlynch99)
path-to-error -

Published by dtolnay over 1 year ago

  • Add a way to construct serde_path_to_error::Error (#18, #21)
  • Do not print path when there is nothing to print (#19, #22)
  • Fix message duplication between error Display and source() (#20)
path-to-error -

Published by dtolnay almost 2 years ago

  • Documentation improvements
path-to-error -

Published by dtolnay about 2 years ago

  • Add categories to crates.io metadata
path-to-error -

Published by dtolnay over 2 years ago

  • Propagate is_human_readable method of the Deserializer (#16, thanks @Kijewski)
path-to-error -

Published by dtolnay almost 3 years ago

  • Support data structures containing 128-bit integers (#15, thanks @ramosbugs)
path-to-error -

Published by dtolnay about 3 years ago

  • Support path to Serialize error (#11)

    use serde::Serialize;
    use std::cell::RefCell;
    
    #[derive(Serialize)]
    struct Outer<'a> {
        k: Inner<'a>,
    }
    
    #[derive(Serialize)]
    struct Inner<'a> {
        refcell: &'a RefCell<String>,
    }
    
    let refcell = RefCell::new(String::new());
    let value = Outer {
        k: Inner { refcell: &refcell },
    };
    
    // A RefCell cannot be serialized while it is still mutably borrowed.
    let _borrowed = refcell.borrow_mut();
    
    // Some Serializer.
    let mut out = Vec::new();
    let jser = &mut serde_json::Serializer::new(&mut out);
    
    let result = serde_path_to_error::serialize(&value, jser);
    match result {
        Ok(_) => panic!("expected failure to serialize RefCell"),
        Err(err) => {
            let path = err.path().to_string();
            assert_eq!(path, "k.refcell");
        }
    }
    
path-to-error -

Published by dtolnay almost 4 years ago

  • Support types containing u128 and i128 (#8, thanks @RReverser)
path-to-error -

Published by dtolnay almost 4 years ago

  • Documentation improvements
path-to-error -

Published by dtolnay about 5 years ago

  • Make the Error type be a proper error (#3, thanks @vorner)
path-to-error -

Published by dtolnay almost 6 years ago

path-to-error -

Published by dtolnay almost 6 years ago