Skip to content

Commit

Permalink
Upgrade to 1.78 Rust
Browse files Browse the repository at this point in the history
- tune Clippy lints
- upgrade Cargo deps
- upgrade Chrome to 124.0 version and Firefox to 125.0.3 version
  • Loading branch information
tyranron committed May 2, 2024
1 parent e3b759d commit b74d951
Show file tree
Hide file tree
Showing 20 changed files with 199 additions and 179 deletions.
311 changes: 159 additions & 152 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ url = "2.3"
android_logger = "0.13"

[target.'cfg(any(target_os = "ios", target_os = "linux", target_os = "macos", target_os = "windows"))'.dependencies]
simple_logger = "4.0"
simple_logger = "5.0"

[target.'cfg(not(target_family = "wasm"))'.dependencies]
dart-sys = "4.0"
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ IMAGE_NAME := $(strip \
$(if $(call eq,$(image),medea-demo-edge),medea-demo,\
$(or $(image),medea-control-api-mock)))

RUST_VER := 1.77
CHROME_VERSION := 122.0
FIREFOX_VERSION := 124.0-driver0.34.0
RUST_VER := 1.78
CHROME_VERSION := 124.0
FIREFOX_VERSION := 125.0.3-driver0.34.0

CARGO_NDK_VER := 3.4.0-ndkr26c-rust$(RUST_VER)
CARGO_NDK_VER := 3.4.0-ndkr26d-rust$(RUST_VER)
ANDROID_TARGETS := aarch64-linux-android \
armv7-linux-androideabi \
i686-linux-android \
Expand Down
10 changes: 5 additions & 5 deletions crates/medea-macro/src/dispatchable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use inflector::Inflector;
use proc_macro::TokenStream;
use proc_macro2::{Ident, Span, TokenStream as TokenStream2, TokenTree};
use proc_macro2::{Span, TokenStream as TokenStream2, TokenTree};
use quote::{quote, ToTokens};
use syn::{
parse::{Parse, ParseStream, Result},
Expand Down Expand Up @@ -100,13 +100,13 @@ pub(crate) struct Item {

/// `Handler` trait ident, basically `{}Handler` where `{}` is an enum
/// name.
handler_trait_ident: Ident,
handler_trait_ident: syn::Ident,
}

impl Parse for Item {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let orig_enum = ItemEnum::parse(input)?;
let handler_trait_ident = Ident::new(
let handler_trait_ident = syn::Ident::new(
&format!("{}Handler", orig_enum.ident),
Span::call_site(),
);
Expand Down Expand Up @@ -276,7 +276,7 @@ impl Args {
attrs: Vec::new(),
by_ref: None,
mutability: None,
ident: Ident::new("handler", Span::call_site()),
ident: syn::Ident::new("handler", Span::call_site()),
subpat: None,
})),
colon_token: token::Colon::default(),
Expand All @@ -288,7 +288,7 @@ impl Args {
.map(|token| {
if let TokenTree::Ident(ident) = &token {
if *ident == "Self" {
return TokenTree::Ident(proc_macro2::Ident::new(
return TokenTree::Ident(syn::Ident::new(
"T",
ident.span(),
));
Expand Down
2 changes: 2 additions & 0 deletions crates/medea-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -73,6 +74,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 2 additions & 0 deletions crates/medea-reactive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -73,6 +74,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 1 addition & 1 deletion e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
async-recursion = "1.0"
cucumber = { version = "0.20", features = ["libtest"] }
cucumber = { version = "0.21", features = ["libtest"] }
derive_more = "0.99"
fantoccini = { version = "0.19", features = ["rustls-tls"], default-features = false }
futures = "0.3"
Expand Down
2 changes: 2 additions & 0 deletions e2e/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -76,6 +77,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
4 changes: 2 additions & 2 deletions flutter/lib/src/web/media_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ class WebMediaManagerHandle implements MediaManagerHandle {

@override
Future<int> microphoneVolume() {
// TODO(logist322): implement microphoneVolume
// TODO: implement microphoneVolume
throw UnimplementedError();
}

@override
Future<void> setMicrophoneVolume(int level) {
// TODO(logist322): implement setMicrophoneVolume
// TODO: implement setMicrophoneVolume
throw UnimplementedError();
}
}
2 changes: 1 addition & 1 deletion mock/control-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "medea-control-api-mock"
version = "0.2.1-dev"
edition = "2021"
rust-version = "1.62"
rust-version = "1.70"
description = "RESTful mock server for Medea's Control API."
authors = ["Instrumentisto Team <developer@instrumentisto.com>"]
license = "BlueOak-1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion mock/control-api/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Medea's Control API mock server
===============================

[![Rust 1.62+](https://img.shields.io/badge/rustc-1.62+-lightgray.svg "Rust 1.62+")](https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html)
[![Rust 1.70+](https://img.shields.io/badge/rustc-1.70+-lightgray.svg "Rust 1.70+")](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html)
[![Unsafe Forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg "Unsafe forbidden")](https://github.com/rust-secure-code/safety-dance)

[Docker Hub](https://hub.docker.com/r/instrumentisto/medea-control-api-mock)
Expand Down
2 changes: 2 additions & 0 deletions mock/control-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -72,6 +73,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 2 additions & 0 deletions mock/control-api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -72,6 +73,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 2 additions & 0 deletions proto/client-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -74,6 +75,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 2 additions & 0 deletions proto/control-api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -74,6 +75,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 2 additions & 0 deletions proto/control-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -73,6 +74,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -72,6 +73,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
4 changes: 2 additions & 2 deletions src/peer/media/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ impl MediaConnections {
send_constraints.clone(),
connection_mode,
);
let sender = sender::Sender::new(
let sender = Sender::new(
&sender_state,
self,
send_constraints.clone(),
Expand Down Expand Up @@ -872,7 +872,7 @@ impl MediaConnections {
sender,
connection_mode,
);
let receiver = receiver::Receiver::new(
let receiver = Receiver::new(
&state,
self,
mpsc::unbounded().0,
Expand Down
13 changes: 5 additions & 8 deletions src/peer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pub enum UpdateLocalStreamError {

/// Events emitted from a [`Sender`] or a [`Receiver`].
///
/// [`Receiver`]: crate::peer::receiver::Receiver
/// [`Sender`]: crate::peer::sender::Sender
/// [`Receiver`]: receiver::Receiver
/// [`Sender`]: sender::Sender
#[derive(Clone, Copy, Debug)]
pub enum TrackEvent {
/// Intention of the `MediaTrack` to mute/unmute himself.
Expand Down Expand Up @@ -1071,19 +1071,16 @@ impl PeerConnection {

/// Lookups [`Sender`] by provided [`TrackId`].
#[must_use]
pub fn get_sender_by_id(
&self,
id: TrackId,
) -> Option<Rc<media::sender::Sender>> {
pub fn get_sender_by_id(&self, id: TrackId) -> Option<Rc<media::Sender>> {
self.media_connections.get_sender_by_id(id)
}

/// Lookups [`media::sender::State`] by the provided [`TrackId`].
/// Lookups [`sender::State`] by the provided [`TrackId`].
#[must_use]
pub fn get_sender_state_by_id(
&self,
id: TrackId,
) -> Option<Rc<media::sender::State>> {
) -> Option<Rc<sender::State>> {
self.media_connections.get_sender_state_by_id(id)
}

Expand Down
2 changes: 0 additions & 2 deletions src/platform/wasm/media_devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//! [1]: https://w3.org/TR/mediacapture-streams#mediadevices
#![allow(clippy::unwrap_used)]
// TODO: False positive in function signatures, try remove on 1.78 Rust upgrade.
#![allow(clippy::let_underscore_untyped)]

use std::{cell::RefCell, rc::Rc};
use wasm_bindgen_futures::JsFuture;
Expand Down

0 comments on commit b74d951

Please sign in to comment.