[serde_trim][docsrs]:: serde deserialize_with string trim
========================================
[docsrs]: https://docs.rs/serde_trim
[](https://github.com/baoyachi/serde_trim/actions?query=workflow%3Acheck)
[](https://crates.io/crates/serde_trim)
[](https://docs.rs/serde_trim)
[](https://crates.io/crates/serde_trim)
[](https://deps.rs/repo/github/baoyachi/serde_trim)
[](https://coveralls.io/github/baoyachi/serde_trim)
## how to use
```rust
fn main() {
#[derive(Debug, Deserialize)]
struct Foo {
#[serde(deserialize_with = "string_trim")]
name: String,
}
let json = r#"{"name":" "}"#;
let foo = serde_json::from_str::<Foo>(json).unwrap();
assert_eq!(foo.name, "");
}
```