Skip to content

Commit 24030ee

Browse files
committed
Upgrade to 1.87 Rust
- bump up MSRV to 1.87 - upgrade `nix` crate to from 0.29 to 0.30 version - update Cargo deps Additionally: - correct attributes sorting in code style
1 parent 17925db commit 24030ee

File tree

13 files changed

+74
-51
lines changed

13 files changed

+74
-51
lines changed

.clippy.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# Project configuration for Clippy Rust code linter.
12
# See full lints list at:
23
# https://rust-lang.github.io/rust-clippy/master/index.html
34

45
absolute-paths-allowed-crates = [
56
"reqwest",
67
]
78

9+
allow-expect-in-tests = true
10+
811
doc-valid-idents = [
912
"KiB", "MiB", "GiB", "TiB", "PiB", "EiB",
1013
"DirectX", "ECMAScript",

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ max_line_length = 80
1010
[*.md]
1111
indent_style = space
1212
indent_size = 4
13-
trim_trailing_whitespace = false
1413
max_line_length = off
1514

1615
[*.rs]

CONTRIBUTING.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Contribution Guide
22
==================
33

4-
We love contributions from everyone, whether it's raising an issue, reporting a bug, adding a feature, or helping improve a documentation. Maintaining the `medea_flutter_webrtc` plugin for all the platforms is not an easy task, so everything you do is support for the project.
4+
We love contributions from everyone, whether it's raising an issue, reporting a bug, adding a feature, or helping improve documentation. Maintaining the `medea_flutter_webrtc` plugin for all the platforms is not an easy task, so everything you do is support for the project.
55

66
1. [Code style](#code-style)
77
- [Rust](#rust)
@@ -29,7 +29,7 @@ Additional rules, not handled by [rustfmt] and [Clippy] are described below.
2929

3030
```rust
3131
#[allow(clippy::mut_mut)]
32-
#[derive(smart_default::SmartDefault, Debug, Deserialize, Serialize)]
32+
#[derive(Debug, Deserialize, Serialize, smart_default::SmartDefault)]
3333
#[serde(deny_unknown_fields)]
3434
struct User {
3535
#[serde(default)]
@@ -41,7 +41,7 @@ struct User {
4141

4242
```rust
4343
#[serde(deny_unknown_fields)]
44-
#[derive(smart_default::SmartDefault, Debug, Deserialize, Serialize)]
44+
#[derive(Debug, Deserialize, Serialize, smart_default::SmartDefault)]
4545
#[allow(clippy::mut_mut)]
4646
struct User {
4747
id: u64,
@@ -55,6 +55,13 @@ struct User {
5555
}
5656
```
5757

58+
```rust
59+
#[derive(smart_default::SmartDefault, Debug, Deserialize, Serialize)]
60+
struct User {
61+
id: u64,
62+
}
63+
```
64+
5865
#### Markdown in docs
5966

6067
It's **recommended to use H1 headers** (`# Header`) in [Rust] docs as this way is widely adopted in [Rust] community. **Blank lines** before headers must be **reduced to a single one**.
@@ -67,9 +74,9 @@ Other **code definitions** should be **referred via ```[`Entity`]``` marking** (
6774

6875
```rust
6976
/// Type of [`User`]'s unique identifier.
70-
///
77+
///
7178
/// # Constraints
72-
///
79+
///
7380
/// - It **must not be zero**.
7481
/// - It _should not_ overflow [`i64::max_value`] due to usage in database.
7582
struct UserId(u64);
@@ -81,9 +88,9 @@ struct UserId(u64);
8188

8289
```rust
8390
/// Type of [`User`]'s unique identifier.
84-
///
91+
///
8592
/// ## Constraints
86-
///
93+
///
8794
/// - It **must not be zero**.
8895
/// - It _should not_ overflow [`i64::max_value`] due to usage in database.
8996
struct UserId(u64);
@@ -93,9 +100,9 @@ struct UserId(u64);
93100

94101
```rust
95102
/// Type of User's unique identifier.
96-
///
103+
///
97104
/// # Constraints
98-
///
105+
///
99106
/// - It **must not be zero**.
100107
/// - It _should not_ overflow `i64::max_value` due to usage in database.
101108
struct UserId(u64);
@@ -105,9 +112,9 @@ struct UserId(u64);
105112

106113
```rust
107114
/// Type of [`User`]'s unique identifier.
108-
///
115+
///
109116
/// # Constraints
110-
///
117+
///
111118
/// - It __must not be zero__.
112119
/// - It *should not* overflow [`i64::max_value`] due to usage in database.
113120
struct UserId(u64);

Cargo.lock

Lines changed: 38 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/libwebrtc-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "libwebrtc-sys"
33
version = "0.0.0+136.0.7103.92"
44
edition = "2024"
5-
rust-version = "1.86"
5+
rust-version = "1.87"
66
publish = false
77
links = "webrtc"
88

crates/libwebrtc-sys/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
clippy::shadow_unrelated,
9191
clippy::significant_drop_in_scrutinee,
9292
clippy::significant_drop_tightening,
93+
clippy::single_option_map,
9394
clippy::str_to_string,
9495
clippy::string_add,
9596
clippy::string_lit_as_bytes,

crates/libwebrtc-sys/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
clippy::shadow_unrelated,
9090
clippy::significant_drop_in_scrutinee,
9191
clippy::significant_drop_tightening,
92+
clippy::single_option_map,
9293
clippy::str_to_string,
9394
clippy::string_add,
9495
clippy::string_lit_as_bytes,
@@ -2813,7 +2814,7 @@ pub enum RtcInboundRtpStreamMediaType {
28132814
/// Transport protocols used in [WebRTC].
28142815
///
28152816
/// [WebRTC]: https://w3.org/TR/webrtc
2816-
#[derive(Debug, Copy, Clone)]
2817+
#[derive(Clone, Copy, Debug)]
28172818
pub enum Protocol {
28182819
/// [Transmission Control Protocol][1].
28192820
///

crates/native/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "medea-flutter-webrtc-native"
33
edition = "2024"
4-
rust-version = "1.86"
4+
rust-version = "1.87"
55
publish = false
66

77
[lib]
@@ -20,7 +20,7 @@ xxhash = { package = "xxhash-rust", version = "0.8", features = ["xxh3"] }
2020

2121
[target.'cfg(target_os = "linux")'.dependencies]
2222
libudev = "0.3"
23-
nix = { version = "0.29", features = ["poll", "signal"] }
23+
nix = { version = "0.30", features = ["poll", "signal"] }
2424
pulse = { version = "2.30", package = "libpulse-binding" }
2525

2626
[target.'cfg(target_os = "windows")'.dependencies]

crates/native/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
clippy::shadow_unrelated,
8888
clippy::significant_drop_in_scrutinee,
8989
clippy::significant_drop_tightening,
90+
clippy::single_option_map,
9091
clippy::str_to_string,
9192
clippy::string_add,
9293
clippy::string_lit_as_bytes,

crates/native/src/api/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ impl From<sys::Protocol> for Protocol {
436436
///
437437
/// [RFC 5245]: https://tools.ietf.org/html/rfc5245
438438
/// [1]: https://w3.org/TR/webrtc#dom-icetransport-role
439-
#[derive(Debug, Copy, Clone)]
439+
#[derive(Clone, Copy, Debug)]
440440
pub enum IceRole {
441-
/// Agent whose role as defined by [Section 3 in RFC 5245][1], has not yet
441+
/// Agent whose role, as defined by [Section 3 in RFC 5245][1], has not yet
442442
/// been determined.
443443
///
444444
/// [1]: https://tools.ietf.org/html/rfc5245#section-3
@@ -2166,7 +2166,7 @@ pub struct AudioProcessingConfig {
21662166
}
21672167

21682168
/// [`AudioProcessingConfig`] noise suppression aggressiveness.
2169-
#[derive(Debug, Copy, Clone)]
2169+
#[derive(Clone, Copy, Debug)]
21702170
pub enum NoiseSuppressionLevel {
21712171
/// Minimal noise suppression.
21722172
Low,

crates/native/src/devices.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ mod linux {
467467
// `socket`.
468468
let socket_fd =
469469
unsafe { BorrowedFd::borrow_raw(socket.as_raw_fd()) };
470-
let fds = PollFd::new(socket_fd, PollFlags::POLLIN);
470+
let mut fds = [PollFd::new(socket_fd, PollFlags::POLLIN)];
471471
loop {
472-
ppoll(&mut [fds], None, None)?;
472+
ppoll(&mut fds, None, None)?;
473473

474474
let Some(event) = socket.receive_event() else {
475475
continue;

crates/native/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
clippy::shadow_unrelated,
8888
clippy::significant_drop_in_scrutinee,
8989
clippy::significant_drop_tightening,
90+
clippy::single_option_map,
9091
clippy::str_to_string,
9192
clippy::string_add,
9293
clippy::string_lit_as_bytes,

0 commit comments

Comments
 (0)