aboutsummaryrefslogtreecommitdiff
path: root/client-native-rift
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
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')
-rw-r--r--client-native-rift/Cargo.toml6
-rw-r--r--client-native-rift/src/main.rs40
2 files changed, 21 insertions, 25 deletions
diff --git a/client-native-rift/Cargo.toml b/client-native-rift/Cargo.toml
index 170b32f..2d90f05 100644
--- a/client-native-rift/Cargo.toml
+++ b/client-native-rift/Cargo.toml
@@ -6,12 +6,12 @@ edition = "2021"
[dependencies]
client-native-lib = { path = "../client-native-lib" }
-clap = { version = "4.1.6", features = ["derive"] }
+clap = { version = "4.3.8", features = ["derive"] }
env_logger = "0.10.0"
log = "0.4"
-tokio = { version = "1.25", features = ["full"] }
+tokio = { version = "1.28", features = ["full"] }
bytes = "1.4.0"
-indicatif = "0.17.3"
+indicatif = "0.17.5"
humansize = "2.1.3"
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| {