summaryrefslogtreecommitdiffstats
path: root/generator/src/main.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-01-17 00:37:31 +0100
committerCyborus <cyborus@cyborus.xyz>2024-01-17 00:37:31 +0100
commited1092bc9e9309bcb902253e294c1e03cba0b9c5 (patch)
tree4dc9c436fc75f1734a2129f246a229e9e1b7dc06 /generator/src/main.rs
parentuse `write!` instead of `.write_fmt` (diff)
downloadforgejo-api-ed1092bc9e9309bcb902253e294c1e03cba0b9c5.tar.xz
forgejo-api-ed1092bc9e9309bcb902253e294c1e03cba0b9c5.zip
use `OffsetDateTime::format` instead of `format_into`
Diffstat (limited to 'generator/src/main.rs')
-rw-r--r--generator/src/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/generator/src/main.rs b/generator/src/main.rs
index 5fb8e9d..be20c25 100644
--- a/generator/src/main.rs
+++ b/generator/src/main.rs
@@ -823,7 +823,7 @@ fn create_query_struct(spec: &OpenApiV2, path: &str, op: &Operation) -> eyre::Re
ParameterType::String => match param.format.as_deref() {
Some("date-time" | "date") => {
writeln!(&mut handler, "s.push_str(\"{}=\");", param.name)?;
- writeln!(&mut handler, "{field_name}.format_into(&mut s, &time::format_description::well_known::Rfc3339).unwrap();")?;
+ writeln!(&mut handler, "s.push_str(&{field_name}.format(&time::format_description::well_known::Rfc3339).unwrap());")?;
writeln!(&mut handler, "s.push('&');")?;
}
_ => {
@@ -849,7 +849,7 @@ fn create_query_struct(spec: &OpenApiV2, path: &str, op: &Operation) -> eyre::Re
ParameterType::String => {
match param.format.as_deref() {
Some("date-time" | "date") => {
- "item.format_into(&mut s, &time::format_description::well_known::Rfc3339).unwrap();"
+ "s.push_str(&item.format(&time::format_description::well_known::Rfc3339).unwrap());"
},
_ => {
"s.push_str(&item);"