Use OccupiedEntry::remove_entry()

This commit is contained in:
Graham Esau 2024-08-24 15:01:31 +01:00
parent fe6275be6e
commit 0f6daccc0a
3 changed files with 4 additions and 6 deletions

4
Cargo.lock generated
View file

@ -383,9 +383,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.125" version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"itoa", "itoa",

View file

@ -15,7 +15,7 @@ rust-version = "1.65"
[dependencies] [dependencies]
schemars_derive = { version = "=1.0.0-alpha.11", optional = true, path = "../schemars_derive" } schemars_derive = { version = "=1.0.0-alpha.11", optional = true, path = "../schemars_derive" }
serde = { version = "1.0", default-features = false, features = ["alloc"]} serde = { version = "1.0", default-features = false, features = ["alloc"]}
serde_json = { version = "1.0.122", default-features = false, features = ["alloc"] } serde_json = { version = "1.0.127", default-features = false, features = ["alloc"] }
dyn-clone = "1.0" dyn-clone = "1.0"
ref-cast = "1.0.22" ref-cast = "1.0.22"

View file

@ -235,9 +235,7 @@ pub fn flatten(schema: &mut Schema, other: Schema) {
} }
} }
"oneOf" | "anyOf" => { "oneOf" | "anyOf" => {
// `OccupiedEntry` currently has no `.remove_entry()` method :( let (key, current) = occupied.remove_entry();
let key = occupied.key().clone();
let current = occupied.remove();
flatten_property( flatten_property(
obj1, obj1,
"allOf".to_owned(), "allOf".to_owned(),