Skip to content

Commit

Permalink
Format Rust code using rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 1, 2024
1 parent 555a3b9 commit cf9b727
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions crates/core/src/fs/named_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ fn build_content_disposition(
.to_str()
.map(|c| c.parse::<Mime>().unwrap_or(mime::APPLICATION_OCTET_STREAM))
.unwrap_or(mime::APPLICATION_OCTET_STREAM);
match (content_type.type_(), content_type.subtype()) {
(mime::IMAGE | mime::TEXT | mime::VIDEO | mime::AUDIO, _)
| (_, mime::JAVASCRIPT | mime::JSON) => "inline",
_ => "attachment",
}
match (content_type.type_(), content_type.subtype()) {
(mime::IMAGE | mime::TEXT | mime::VIDEO | mime::AUDIO, _)
| (_, mime::JAVASCRIPT | mime::JSON) => "inline",
_ => "attachment",
}
}
});
let content_disposition = if disposition_type == "attachment" {
Expand Down
5 changes: 4 additions & 1 deletion crates/serve-static/src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,10 @@ impl Handler for StaticDir {
let builder = {
let mut builder = NamedFile::builder(named_path).content_type(
mime_infer::from_ext(ext.as_deref().unwrap_or_default())
.first_or_octet_stream().as_ref().parse::<HeaderValue>().unwrap_or(APPLICATION_OCTET_STREAM),
.first_or_octet_stream()
.as_ref()
.parse::<HeaderValue>()
.unwrap_or(APPLICATION_OCTET_STREAM),
);
if let Some(content_encoding) = content_encoding {
builder = builder.content_encoding(content_encoding);
Expand Down

0 comments on commit cf9b727

Please sign in to comment.