aboutsummaryrefslogtreecommitdiff
path: root/client-native-rift/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-06-25 09:18:20 +0200
committermetamuffin <metamuffin@disroot.org>2023-06-25 09:18:20 +0200
commit462d9c511ad96cd2270d44bada243d981d5891e3 (patch)
treee5c62ab6d8cdbb67e132d8275e999bb091ac60e1 /client-native-rift/src
parente7a3c758bdd63d2a444f2fe578e54045c43ad6bb (diff)
downloadkeks-meet-462d9c511ad96cd2270d44bada243d981d5891e3.tar
keks-meet-462d9c511ad96cd2270d44bada243d981d5891e3.tar.bz2
keks-meet-462d9c511ad96cd2270d44bada243d981d5891e3.tar.zst
update all of the rusty stuff. also fixed webrtc build problems
Diffstat (limited to 'client-native-rift/src')
-rw-r--r--client-native-rift/src/main.rs40
1 files changed, 18 insertions, 22 deletions
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 <metamuffin@disroot.org>
*/
-#![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| {