Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization/deserialization not working properly #33

Open
crabdancing opened this issue May 22, 2024 · 2 comments
Open

Serialization/deserialization not working properly #33

crabdancing opened this issue May 22, 2024 · 2 comments

Comments

@crabdancing
Copy link

crabdancing commented May 22, 2024

Steps to reproduce:

  1. Downloads words.txt
fn main() {
    let mut t = TrieBuilder::new();
    for word in std::fs::read_to_string("words.txt")
        .unwrap()
        .split_whitespace()
    {
        if !word.trim().is_empty() {
            t.push(word);
        }
    }
    let t = t.build();
    println!("Loaded");
    let mut f = File::create_new("words.toml").unwrap();
    write!(f, "{}", toml::to_string(&t).unwrap()).unwrap();
}
Loaded
thread 'main' panicked at src/main.rs:57:41:
called `Result::unwrap()` on an `Err` value: Error { inner: UnsupportedType(Some("unit")) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Other libraries like postcard also fail, but with deserialization failing instead.

@shanecelis
Copy link
Collaborator

Thank you for reporting this.

@crabdancing
Copy link
Author

No worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants