Fix all compilation issues.

This commit is contained in:
Florian THIERRY
2026-07-14 13:55:41 +02:00
parent c24df944c5
commit f8fd59b01a
28 changed files with 752 additions and 284 deletions
+3 -3
View File
@@ -1,14 +1,14 @@
use actix_web::{get, HttpResponse};
use actix_web::{get, HttpResponse, Responder};
use tokio::fs::File;
use tokio_util::codec::{BytesCodec, FramedRead};
use futures_util::stream::StreamExt;
#[get("/download")]
pub async fn download_file() -> HttpResponse {
pub async fn download_file() -> impl Responder {
HttpResponse::Ok()
.content_type("application/octet-stream")
.streaming(async_stream::stream! {
let file = File::open("/home/florian/Video/2019-06-02 17-09-30.flv").await.expect("Failed to open file");
let file = File::open("/home/florian/Videos/Kaamelott_Le_film.avi").await.expect("Failed to open file");
let mut stream = FramedRead::new(file, BytesCodec::new());
while let Some(chunk) = stream.next().await {
yield chunk.map(|bytes| bytes.freeze());