Compare commits

...

2 commits

Author SHA1 Message Date
2f8920eefe
fix: add newlines
ugly code but without it the output is uglier
2024-10-19 05:02:18 +02:00
a6576f1947
fix: add trailing empty line 2024-10-19 04:56:36 +02:00
2 changed files with 5 additions and 2 deletions

View file

@ -109,5 +109,7 @@ async fn main() -> Result<(), PostWomanError> {
// }, // },
} }
eprintln!();
Ok(()) Ok(())
} }

View file

@ -152,13 +152,14 @@ impl Endpoint {
StringOr::Str(_query) => todo!(), StringOr::Str(_query) => todo!(),
StringOr::T(Extractor::Discard) => "".to_string(), StringOr::T(Extractor::Discard) => "".to_string(),
StringOr::T(Extractor::Debug) => format!("{res:#?}\n"), StringOr::T(Extractor::Debug) => format!("{res:#?}\n"),
StringOr::T(Extractor::Body) => res.text().await?, StringOr::T(Extractor::Body) => res.text().await? + "\n",
StringOr::T(Extractor::Header { key }) => res StringOr::T(Extractor::Header { key }) => res
.headers() .headers()
.get(&key) .get(&key)
.ok_or(PostWomanError::HeaderNotFound(key))? .ok_or(PostWomanError::HeaderNotFound(key))?
.to_str()? .to_str()?
.to_string(), .to_string()
+ "\n",
}) })
} }
} }