Added MultipartFile extractors.

Moved cfg macro to lib where possible.

Changed some features, and made some deps optional
This commit is contained in:
Martin Berg Alstad
2024-06-30 20:16:17 +02:00
parent e0baff8625
commit 0898a50166
17 changed files with 287 additions and 55 deletions

View File

@ -1,7 +1,5 @@
#[cfg(feature = "tokio")]
use {std::io::Error, tokio::fs::File, tokio_util::io::ReaderStream};
#[cfg(feature = "tokio")]
pub async fn load_file<Path>(file_path: Path) -> Result<ReaderStream<File>, Error>
where
Path: AsRef<std::path::Path>,
@ -9,7 +7,7 @@ where
File::open(file_path).await.map(ReaderStream::new)
}
#[cfg(all(test, feature = "tokio"))]
#[cfg(test)]
mod tests {
use super::*;