global: snapshot

This commit is contained in:
nym21
2025-08-04 11:38:46 +02:00
parent a2f5704581
commit 5b855fd835
8 changed files with 191 additions and 127 deletions

View File

@@ -89,21 +89,7 @@ fn req_to_response_res(
Response::new(Body::from(v))
} else {
match interface.format(vecs, &params.rest)? {
Output::CSV(s) => {
if let GuardResult::Guard(g) = guard_res {
g.insert(s.clone().into())
.map_err(|_| Error::QuickCacheError)?;
}
s.into_response()
}
Output::TSV(s) => {
if let GuardResult::Guard(g) = guard_res {
g.insert(s.clone().into())
.map_err(|_| Error::QuickCacheError)?;
}
s.into_response()
}
Output::MD(s) => {
Output::CSV(s) | Output::TSV(s) | Output::MD(s) => {
if let GuardResult::Guard(g) = guard_res {
g.insert(s.clone().into())
.map_err(|_| Error::QuickCacheError)?;
@@ -143,7 +129,7 @@ fn req_to_response_res(
Format::JSON => headers.insert_content_type_application_json(),
}
}
_ => headers.insert_content_type_application_json(),
None => headers.insert_content_type_application_json(),
};
Ok(response)