From 2318a33f9b359ae27b52cd9a19db1f6782d8dae3 Mon Sep 17 00:00:00 2001 From: Vika Date: Thu, 1 Aug 2024 22:50:28 +0300 Subject: Upgrade dependencies and fix deprecated functionality I think I managed to not lose any functionality from my dependencies. sqlparser remains unupgraded, but that's mostly because it is only used in one example and it's not worth it to upgrade right now. --- src/media/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/media') diff --git a/src/media/mod.rs b/src/media/mod.rs index 47f456a..7884ef8 100644 --- a/src/media/mod.rs +++ b/src/media/mod.rs @@ -1,6 +1,8 @@ use axum::{ - extract::{multipart::Multipart, FromRef, Host, Path, State}, headers::{HeaderMapExt, HeaderValue, IfNoneMatch}, response::{IntoResponse, Response}, TypedHeader + extract::{multipart::Multipart, FromRef, Host, Path, State}, response::{IntoResponse, Response} }; +use axum_extra::headers::{HeaderMapExt, HeaderValue, IfNoneMatch}; +use axum_extra::TypedHeader; use kittybox_util::error::{MicropubError, ErrorType}; use kittybox_indieauth::Scope; use crate::indieauth::{backend::AuthBackend, User}; @@ -74,7 +76,7 @@ pub(crate) async fn serve( tracing::debug!("Metadata: {:?}", metadata); let etag = if let Some(etag) = metadata.etag { - let etag = format!("\"{}\"", etag).parse::().unwrap(); + let etag = format!("\"{}\"", etag).parse::().unwrap(); if let Some(TypedHeader(if_none_match)) = if_none_match { tracing::debug!("If-None-Match: {:?}", if_none_match); @@ -110,7 +112,7 @@ pub(crate) async fn serve( headers.typed_insert(etag); } } - r.body(axum::body::StreamBody::new(stream)) + r.body(axum::body::Body::from_stream(stream)) .unwrap() .into_response() }, -- cgit 1.4.1