#![allow( // clippy is broken and shows wrong warnings // clippy on stable does not know yet about the lint name
unknown_lints, // https://github.com/rust-lang/rust-clippy/issues/8867
clippy::derive_partial_eq_without_eq,
)]
mod utils;
usecrate::utils::{check_deserialization, check_error_deserialization, is_equal}; use core::iter::FromIterator; use expect_test::expect; use indexmap_1::{IndexMap, IndexSet}; use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr, Same}; use std::net::IpAddr;
// Different value and key always works
is_equal(
S(IndexMap::from_iter(vec![(1, 1), (2, 2), (3, 3)])),
expect![[r#"
{ "1": 1, "2": 2, "3": 3
}"#]],
);
// Same value for different keys is ok
is_equal(
S(IndexMap::from_iter(vec![(1, 1), (2, 1), (3, 1)])),
expect![[r#"
{ "1": 1, "2": 1, "3": 1
}"#]],
);
// Duplicate keys are an error
check_error_deserialization::<S>(
r#"{"1": 1, "2": 2, "1": 3}"#,
expect![[r#"invalid entry: found duplicate key at line 1 column 24"#]],
);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.