1
0
Fork 0
forked from wry/wry

all: set rust edition to 2024

This commit is contained in:
Julian Orth 2025-02-21 10:44:29 +01:00
parent 02a18f620b
commit 3338909170
515 changed files with 1225 additions and 1187 deletions

View file

@ -4,7 +4,7 @@ use {
StringSpec, TableSpec, TopLevelTypeSpec, VariantSpec,
},
anyhow::Result,
serde_json::{json, Map, Value},
serde_json::{Map, Value, json},
};
pub fn generate_json_schema(

View file

@ -106,7 +106,10 @@ fn write_variant_spec(buf: &mut Vec<u8>, spec: &VariantSpec) -> Result<()> {
let ts = spec!(ts);
match ts {
TableSpec::Tagged { types } => {
writeln!(buf, "This table is a tagged union. The variant is determined by the `type` field. It takes one of the following values:")?;
writeln!(
buf,
"This table is a tagged union. The variant is determined by the `type` field. It takes one of the following values:"
)?;
writeln!(buf)?;
for (name, spec) in types {
writeln!(buf, "- `{name}`:")?;

View file

@ -2,8 +2,8 @@ use {
error_reporter::Report,
indexmap::IndexMap,
serde::{
de::{DeserializeOwned, Error},
Deserialize, Deserializer,
de::{DeserializeOwned, Error},
},
};
@ -119,7 +119,7 @@ impl<'de> Deserialize<'de> for TopLevelTypeSpec {
"spec must define either variants or a single variant. failures: {} ----- {}",
Report::new(e1),
Report::new(e2)
)))
)));
}
};
Ok(res)
@ -148,7 +148,7 @@ impl<'de> Deserialize<'de> for TableSpec {
"spec must define either types or fields. failures: {} ----- {}",
Report::new(e1),
Report::new(e2)
)))
)));
}
};
Ok(res)
@ -176,7 +176,7 @@ impl<'de, U: DeserializeOwned> Deserialize<'de> for RefOrSpec<U> {
"spec must define either a ref or a spec. failures: {} ----- {}",
Report::new(e1),
Report::new(e2)
)))
)));
}
};
Ok(res)