From 462d9c511ad96cd2270d44bada243d981d5891e3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 25 Jun 2023 09:18:20 +0200 Subject: update all of the rusty stuff. also fixed webrtc build problems --- client-native-rift/src/main.rs | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'client-native-rift/src') diff --git a/client-native-rift/src/main.rs b/client-native-rift/src/main.rs index 0221a98..6d02a0d 100644 --- a/client-native-rift/src/main.rs +++ b/client-native-rift/src/main.rs @@ -3,7 +3,6 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2022 metamuffin */ -#![feature(box_syntax)] use bytes::Bytes; use clap::{Parser, Subcommand}; @@ -78,23 +77,21 @@ async fn run() { match &args.action { Action::Send { filename } => { - inst.add_local_resource( - Box::new(FileSender { - info: ProvideInfo { - id: "the-file".to_string(), // we only share a single file so its fine - kind: "file".to_string(), - track_kind: None, - label: Some(filename.clone().unwrap_or("stdin".to_string())), - size: if let Some(filename) = &filename { - Some(fs::metadata(filename).await.unwrap().size() as usize) - } else { - None - }, + inst.add_local_resource(Box::new(FileSender { + info: ProvideInfo { + id: "the-file".to_string(), // we only share a single file so its fine + kind: "file".to_string(), + track_kind: None, + label: Some(filename.clone().unwrap_or("stdin".to_string())), + size: if let Some(filename) = &filename { + Some(fs::metadata(filename).await.unwrap().size() as usize) + } else { + None }, - reader_factory: args.action, - }) - .await, - ); + }, + reader_factory: args.action, + })) + .await; } _ => (), } @@ -312,8 +309,8 @@ impl LocalResource for FileSender { let reader = reader.clone(); let pos = pos.clone(); let channel2 = channel.clone(); - channel.on_buffered_amount_low( - Box::new(move || { + channel + .on_buffered_amount_low(Box::new(move || { let pos = pos.clone(); let reader = reader.clone(); let channel = channel2.clone(); @@ -344,9 +341,8 @@ impl LocalResource for FileSender { .unwrap(); } }) - }) - .await, - ); + })) + .await; channel.set_buffered_amount_low_threshold(1).await; } channel.on_error(Box::new(move |err| { -- cgit v1.2.3-70-g09d2