We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following Cargo.toml:
Cargo.toml
[package] name = "test_set" version = "0.1.0" edition = "2021" [dependencies] toml_edit = { version = "0.14", features = ["easy"] } serde = "1.0" petitset = {version = "0.2", features = ["serde_compat"]}
and the following code with HashSet:
HashSet
use std::collections::HashSet; use serde::Serialize; #[derive(Serialize)] struct Bar { foo: HashSet<Foo>, } #[derive(Serialize, Hash, PartialEq, Eq, Clone, Copy)] enum Foo { #[serde(rename = "hello")] Hello, } fn main() { let mut foo = HashSet::new(); foo.insert(Foo::Hello); let bar = Bar { foo, }; println!("{}", toml_edit::ser::to_string(&bar).unwrap()); }
It prints foo = ["hello"].
foo = ["hello"]
But with PetitSet:
PetitSet
use petitset::PetitSet; use serde::Serialize; #[derive(Serialize)] struct Bar { foo: PetitSet<Foo, 3>, } #[derive(Serialize, Hash, PartialEq, Eq, Clone, Copy)] enum Foo { #[serde(rename = "hello")] Hello, } fn main() { let mut foo = PetitSet::new(); foo.insert(Foo::Hello); let bar = Bar { foo, }; println!("{}", toml_edit::ser::to_string(&bar).unwrap()); }
it prints nothing. Is this expected?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider the following
Cargo.toml
:and the following code with
HashSet
:It prints
foo = ["hello"]
.But with
PetitSet
:it prints nothing. Is this expected?
The text was updated successfully, but these errors were encountered: