aboutsummaryrefslogtreecommitdiff
path: root/src/modules/files.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-10 17:21:53 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-10 17:21:53 +0200
commitc88d6e280a669eca44b8331b8731cf5fc933a957 (patch)
treef089a5402808a281a13be7b58593aaa829c8e109 /src/modules/files.rs
parent6d0bac25aa3f118de34a9f05d939f60d80f550a5 (diff)
downloadgnix-c88d6e280a669eca44b8331b8731cf5fc933a957.tar
gnix-c88d6e280a669eca44b8331b8731cf5fc933a957.tar.bz2
gnix-c88d6e280a669eca44b8331b8731cf5fc933a957.tar.zst
clippy
Diffstat (limited to 'src/modules/files.rs')
-rw-r--r--src/modules/files.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/modules/files.rs b/src/modules/files.rs
index 4fdd5cd..607cee1 100644
--- a/src/modules/files.rs
+++ b/src/modules/files.rs
@@ -167,18 +167,15 @@ impl Node for Files {
} else {
Response::new(BoxBody::new(StreamBody::new(
StreamBody::new(file_stream(file, 4096, range.clone()))
- .map(|e| e.map(|e| Frame::data(e)).map_err(ServiceError::Io)),
+ .map(|e| e.map(Frame::data).map_err(ServiceError::Io)),
)))
};
- if !skip_body {
- if range.end - range.start != metadata.len() {
- *r.status_mut() = StatusCode::PARTIAL_CONTENT;
- r.headers_mut().typed_insert(
- ContentRange::bytes(range.clone(), metadata.len())
- .expect("valid ContentRange"),
- );
- }
+ if !skip_body && range.end - range.start != metadata.len() {
+ *r.status_mut() = StatusCode::PARTIAL_CONTENT;
+ r.headers_mut().typed_insert(
+ ContentRange::bytes(range.clone(), metadata.len()).expect("valid ContentRange"),
+ );
}
// if not_modified || etag_matches {
if not_modified {