mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-27 00:00:24 +02:00
Replace public use of mime crate with &str (#642)
Replaces `Field::content_type`'s return type with `&str`. This is a breaking change. Closes #637
This commit is contained in:
committed by
David Pedersen
parent
4df4e07e10
commit
9b4232b786
@@ -65,8 +65,16 @@ async fn accept_form(
|
||||
) {
|
||||
while let Some(field) = multipart.next_field().await.unwrap() {
|
||||
let name = field.name().unwrap().to_string();
|
||||
let file_name = field.file_name().unwrap().to_string();
|
||||
let content_type = field.content_type().unwrap().to_string();
|
||||
let data = field.bytes().await.unwrap();
|
||||
|
||||
println!("Length of `{}` is {} bytes", name, data.len());
|
||||
println!(
|
||||
"Length of `{}` (`{}`: `{}`) is {} bytes",
|
||||
name,
|
||||
file_name,
|
||||
content_type,
|
||||
data.len()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user