Skip to content

Commit

Permalink
upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed May 24, 2024
1 parent 7a3e66a commit 6c1f088
Show file tree
Hide file tree
Showing 10 changed files with 376 additions and 317 deletions.
608 changes: 323 additions & 285 deletions Cargo.lock

Large diffs are not rendered by default.

30 changes: 19 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[workspace]
members = [
"repl",
"srs",
"stubs",
"tts",
]
members = ["repl", "srs", "stubs", "tts"]
resolver = "2"

[workspace.package]
version = "0.7.1"
Expand All @@ -14,16 +10,24 @@ rust-version = "1.78"
edition = "2021"

[workspace.dependencies]
base64 = "0.13"
bytes = "1.2"
base64 = "0.22"
bytes = "1.6"
futures-util = { version = "0.3", features = ["sink"] }
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "1.0"
tokio = { version = "1.24", features = ["rt-multi-thread", "io-util", "net", "sync", "time", "parking_lot", "macros"] }
tokio = { version = "1.37", features = [
"rt-multi-thread",
"io-util",
"net",
"sync",
"time",
"parking_lot",
"macros",
] }
tokio-stream = { version = "0.1", features = ["sync"] }
tonic = "0.8"
tonic = "0.11"

[package]
name = "dcs-grpc"
Expand All @@ -44,7 +48,11 @@ igrf = "0.2"
libloading = { version = "0.8", optional = true }
log4rs = "1.0"
log.workspace = true
mlua = { version = "0.9", default-features = false, features = ["lua51", "module", "serialize"] }
mlua = { version = "0.9", default-features = false, features = [
"lua51",
"module",
"serialize",
] }
once_cell = "1.4.0"
pin-project = "1.0"
serde.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions repl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ license.workspace = true
edition.workspace = true

[dependencies]
clap = { version = "3.0", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }
stubs = { package = "dcs-grpc-stubs", path = "../stubs", features = ["client"] }
serde_json.workspace = true
thiserror.workspace = true
tokio = { version = "1.24", features = ["rt-multi-thread"] }
tokio = { version = "1.24", features = ["rt-multi-thread", "macros"] }
tonic.workspace = true
3 changes: 2 additions & 1 deletion repl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use tonic::{transport, Code, Status};
#[derive(Parser)]
#[clap(name = "repl")]
struct Opts {
#[clap(short, long, possible_values = ["mission", "hook"], default_value = "mission")]
#[clap(short, long, default_value = "mission",
value_parser = clap::builder::PossibleValuesParser::new(["mission", "hook"]))]
env: String,
}

Expand Down
4 changes: 2 additions & 2 deletions src/rpc/srs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ impl SrsService for Srs {
let mut client = ::srs::Client::new(
name,
request.frequency,
match Coalition::from_i32(request.coalition) {
Some(Coalition::Red) => ::srs::Coalition::Red,
match Coalition::try_from(request.coalition) {
Ok(Coalition::Red) => ::srs::Coalition::Red,
_ => ::srs::Coalition::Blue,
},
);
Expand Down
4 changes: 2 additions & 2 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub async fn stream_units(
let poll_rate = opts.poll_rate.unwrap_or(5);
let max_backoff = Duration::from_secs(opts.max_backoff.unwrap_or(30).max(poll_rate) as u64);
let poll_rate = Duration::from_secs(poll_rate as u64);
let category = GroupCategory::from_i32(opts.category).unwrap_or(GroupCategory::Unspecified);
let category = GroupCategory::try_from(opts.category).unwrap_or(GroupCategory::Unspecified);
let mut state = State {
units: HashMap::new(),
ctx: Context {
Expand Down Expand Up @@ -151,7 +151,7 @@ async fn handle_event(
let unit_category = unit
.group
.as_ref()
.and_then(|group| GroupCategory::from_i32(group.category))
.and_then(|group| GroupCategory::try_from(group.category).ok())
.unwrap_or(GroupCategory::Unspecified);
if category == unit_category || category == GroupCategory::Unspecified {
state
Expand Down
5 changes: 4 additions & 1 deletion srs/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ impl<'de> ::serde::Deserialize<'de> for Coalition {
}

pub fn create_sguid() -> String {
use base64::prelude::BASE64_URL_SAFE_NO_PAD;
use base64::Engine;

let sguid = Uuid::new_v4();
let sguid = base64::encode_config(sguid.as_bytes(), base64::URL_SAFE_NO_PAD);
let sguid = BASE64_URL_SAFE_NO_PAD.encode(sguid.as_bytes());
assert_eq!(sguid.len(), 22);
sguid
}
Expand Down
8 changes: 4 additions & 4 deletions stubs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ license.workspace = true
edition.workspace = true

[dependencies]
prost = "0.11"
prost-types = "0.11"
prost = "0.12"
prost-types = "0.12"
serde.workspace = true
tonic.workspace = true

[build-dependencies]
tonic-build = "0.8"
protoc-bundled = { git = "https://github.com/rkusa/protoc-bundled.git", rev = "3.21.6" }
tonic-build = "0.11"
protoc-bundled = { git = "https://github.com/rkusa/protoc-bundled.git", rev = "27.0.0" }

[dev-dependencies]
serde_json.workspace = true
Expand Down
23 changes: 15 additions & 8 deletions tts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,27 @@ base64.workspace = true
bytes.workspace = true
log.workspace = true
ogg = "0.9"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] }
rusoto_core = { version="0.48", default_features = false, features = ["rustls"] }
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls",
"json",
] }
rusoto_core = { version = "0.48", default_features = false, features = [
"rustls",
] }
rusoto_credential = "0.48"
rusoto_polly = { version="0.48", default_features = false, features = ["rustls"] }
rusoto_polly = { version = "0.48", default_features = false, features = [
"rustls",
] }
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tokio.workspace = true

[target.'cfg(target_os = "windows")'.dependencies.windows]
version = "0.40"
version = "0.56"
features = [
"Foundation",
"Foundation_Collections",
"Storage_Streams",
"Media_SpeechSynthesis",
"Foundation",
"Foundation_Collections",
"Storage_Streams",
"Media_SpeechSynthesis",
]
4 changes: 3 additions & 1 deletion tts/src/gcloud.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::io::Cursor;

use base64::prelude::BASE64_STANDARD;
use base64::Engine;
use ogg::reading::PacketReader;
use reqwest::StatusCode;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -44,7 +46,7 @@ pub async fn synthesize(text: &str, config: &GCloudConfig) -> Result<Vec<Vec<u8>

// Convert ogg audio data to opus frames
let data: TextToSpeechResponse = res.json().await?;
let data = base64::decode(data.audio_content)?;
let data = BASE64_STANDARD.decode(data.audio_content)?;
let data = Cursor::new(data);
let mut frames = Vec::new();
let mut audio = PacketReader::new(data);
Expand Down

0 comments on commit 6c1f088

Please sign in to comment.