Skip to content

Commit 4d01189

Browse files
authored
Merge branch 'webrtc-rs:master' into master
2 parents dfe2363 + ea04e68 commit 4d01189

File tree

132 files changed

+583
-514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+583
-514
lines changed

.github/workflows/cargo.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
working-directory: "C:\\a\\webrtc\\webrtc"
8989
run: cargo test --features metrics
9090

91-
rustfmt_and_clippy:
91+
quality:
9292
name: Check formatting style and run clippy
9393
runs-on: ubuntu-latest
9494
steps:
@@ -116,3 +116,5 @@ jobs:
116116
with:
117117
command: fmt
118118
args: --all -- --check
119+
- name: Check for typos
120+
uses: crate-ci/typos@master

_typos.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[type.po]
2+
extend-glob = ["*.csr"]
3+
check-file = false
4+
5+
[default.extend-words]
6+
# Additionals is important for WebRTC
7+
additionals = "additionals"
8+
# STAP-A for WebRTC
9+
stap = "stap"
10+
# MIS value
11+
mis = "mis"
12+
# datas is used a lot for plural.
13+
datas = "datas"
14+
# 2nd for second
15+
2nd = "2nd"

constraints/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ rust-version = "1.63.0"
1616
indexmap = "1.9.1"
1717
serde = { version = "1.0.137", features = ["derive"], optional = true }
1818
ordered-float = { version = "3.0.0", default-features = false }
19+
thiserror = "1.0"
1920

2021
[dev-dependencies]
2122
env_logger = "0.9.0"

constraints/src/algorithms/fitness_distance/value_constraint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl_numeric_value_constraint!(setting: i64, constraint: u64);
160160
impl_numeric_value_constraint!(setting: i64, constraint: f64);
161161
impl_numeric_value_constraint!(setting: f64, constraint: u64);
162162

163-
// Specialized implementations for boolean value constraints of mis-matching
163+
// Specialized implementations for boolean value constraints of mismatching
164164
// and thus either "existence"-checked or ignored setting types:
165165
macro_rules! impl_exists_value_constraint {
166166
(settings: [$($s:ty),+], constraint: bool) => {

constraints/src/algorithms/fitness_distance/value_range_constraint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl_value_range_constraint!(setting: i64, constraint: u64);
142142
impl_value_range_constraint!(setting: i64, constraint: f64);
143143
impl_value_range_constraint!(setting: f64, constraint: u64);
144144

145-
// Specialized implementations for non-boolean value constraints of mis-matching,
145+
// Specialized implementations for non-boolean value constraints of mismatching,
146146
// and thus ignored setting types:
147147
macro_rules! impl_ignored_value_range_constraint {
148148
(settings: [$($s:ty),+], constraint: $c:ty) => {

constraints/src/algorithms/select_settings.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use std::collections::HashSet;
22

3+
use thiserror::Error;
4+
35
use crate::algorithms::fitness_distance::SettingFitnessDistanceError;
46
use crate::errors::OverconstrainedError;
57
use crate::{MediaTrackSettings, SanitizedMediaTrackConstraints};
@@ -24,16 +26,11 @@ pub enum DeviceInformationExposureMode {
2426
}
2527

2628
/// An error type indicating a failure of the `SelectSettings` algorithm.
27-
#[derive(Clone, Eq, PartialEq, Debug)]
29+
#[derive(Error, Clone, Eq, PartialEq, Debug)]
2830
pub enum SelectSettingsError {
2931
/// An error caused by one or more over-constrained settings.
30-
Overconstrained(OverconstrainedError),
31-
}
32-
33-
impl From<OverconstrainedError> for SelectSettingsError {
34-
fn from(error: OverconstrainedError) -> Self {
35-
Self::Overconstrained(error)
36-
}
32+
#[error(transparent)]
33+
Overconstrained(#[from] OverconstrainedError),
3734
}
3835

3936
/// This function implements steps 1-5 of the `SelectSettings` algorithm
@@ -110,7 +107,7 @@ where
110107
// # Important
111108
// Instead of return just ONE settings instance "with the smallest fitness distance, as calculated in step 3"
112109
// we instead return ALL settings instances "with the smallest fitness distance, as calculated in step 3"
113-
// and leave tie-breaking to the User Agent in a seperate step:
110+
// and leave tie-breaking to the User Agent in a separate step:
114111
Ok(select_optimal_candidates(candidates))
115112
}
116113

constraints/src/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
55
use std::collections::HashMap;
66

7+
use thiserror::Error;
8+
79
use crate::algorithms::{ConstraintFailureInfo, SettingFitnessDistanceErrorKind};
810
use crate::MediaTrackProperty;
911

1012
/// An error indicating one or more over-constrained settings.
11-
#[derive(Clone, Eq, PartialEq, Debug)]
13+
#[derive(Error, Clone, Eq, PartialEq, Debug)]
1214
pub struct OverconstrainedError {
1315
/// The offending constraint's name.
1416
pub constraint: MediaTrackProperty,
@@ -27,16 +29,14 @@ impl Default for OverconstrainedError {
2729

2830
impl std::fmt::Display for OverconstrainedError {
2931
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30-
write!(f, "Overconstrained property {:?}", self.constraint)?;
32+
write!(f, "Over-constrained property {:?}", self.constraint)?;
3133
if let Some(message) = self.message.as_ref() {
3234
write!(f, ": {message}")?;
3335
}
3436
Ok(())
3537
}
3638
}
3739

38-
impl std::error::Error for OverconstrainedError {}
39-
4040
impl OverconstrainedError {
4141
pub(super) fn exposing_device_information(
4242
failed_constraints: HashMap<MediaTrackProperty, ConstraintFailureInfo>,

data/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
## v0.5.0
2424

2525
* [#16 [PollDataChannel] reset shutdown_fut future after done](https://github.com/webrtc-rs/data/pull/16) by [@melekes](https://github.com/melekes).
26-
* Increase min verison of `log` dependency to `0.4.16`. [#250 Fix log at ^0.4.16 to make tests compile](https://github.com/webrtc-rs/webrtc/pull/250) by [@k0nserv](https://github.com/k0nserv).
26+
* Increase min version of `log` dependency to `0.4.16`. [#250 Fix log at ^0.4.16 to make tests compile](https://github.com/webrtc-rs/webrtc/pull/250) by [@k0nserv](https://github.com/k0nserv).
2727

2828
## Prior to 0.4.0
2929

dtls/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
## v0.6.0
1919

2020
* [#254 [DTLS] Add NamedCurve::P384](https://github.com/webrtc-rs/webrtc/pull/254) contributed by [neonphog](https://github.com/neonphog)
21-
* Increased min verison of `log` dependency to `0.4.16`. [#250 Fix log at ^0.4.16 to make tests compile](https://github.com/webrtc-rs/webrtc/pull/250) by [@k0nserv](https://github.com/k0nserv).
21+
* Increased min version of `log` dependency to `0.4.16`. [#250 Fix log at ^0.4.16 to make tests compile](https://github.com/webrtc-rs/webrtc/pull/250) by [@k0nserv](https://github.com/k0nserv).
2222
* Increased serde's minimum version to 1.0.110 [#243 Fixes for cargo minimal-versions](https://github.com/webrtc-rs/webrtc/pull/243) contributed by [algesten](https://github.com/algesten)
2323

2424
## Prior to 0.6.0

dtls/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ aes-gcm = "0.10.1"
3131
ccm = "0.3.0"
3232
tokio = { version = "1.19", features = ["full"] }
3333
async-trait = "0.1.56"
34-
x25519-dalek = { version = "2.0.0-rc.2", features = ["static_secrets"] }
34+
x25519-dalek = { version = "2", features = ["static_secrets"] }
3535
x509-parser = "0.13.2"
3636
der-parser = "8.1"
3737
rcgen = "0.10.0"

0 commit comments

Comments
 (0)