Skip to content

Commit 487ea32

Browse files
authored
fix!: typos (#490)
* chore: fix typos * ci: integrate typos checker * fix: alls -> allocs causes shadowing, but the shawoing makes perfect sense * style: new line at eof
1 parent b0d5662 commit 487ea32

File tree

89 files changed

+175
-158
lines changed

Some content is hidden

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

89 files changed

+175
-158
lines changed

.github/workflows/cargo.yml

+3-1
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

+15
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/src/algorithms/fitness_distance/value_constraint.rs

+1-1
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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ where
107107
// # Important
108108
// Instead of return just ONE settings instance "with the smallest fitness distance, as calculated in step 3"
109109
// we instead return ALL settings instances "with the smallest fitness distance, as calculated in step 3"
110-
// 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:
111111
Ok(select_optimal_candidates(candidates))
112112
}
113113

data/CHANGELOG.md

+1-1
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

+1-1
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/src/conn/conn_test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,7 @@ async fn send_client_hello(
23742374
// a ClientHello contained that extension or not
23752375
#[cfg(not(target_os = "windows"))] // this times out in CI on windows.
23762376
#[tokio::test]
2377-
async fn test_renegotation_info() -> Result<()> {
2377+
async fn test_renegotiation_info() -> Result<()> {
23782378
let mut resp = vec![0u8; 1024];
23792379

23802380
let tests = vec![
@@ -2440,13 +2440,13 @@ async fn test_renegotation_info() -> Result<()> {
24402440
}
24412441
};
24422442

2443-
let got_negotation_info = server_hello
2443+
let got_negotiation_info = server_hello
24442444
.extensions
24452445
.iter()
24462446
.any(|v| matches!(v, Extension::RenegotiationInfo(_)));
24472447

24482448
assert!(
2449-
got_negotation_info,
2449+
got_negotiation_info,
24502450
"{name}: Received ServerHello without RenegotiationInfo"
24512451
);
24522452

dtls/src/extension/renegotiation_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::error::Error::ErrInvalidPacketLength;
77
const RENEGOTIATION_INFO_HEADER_SIZE: usize = 5;
88

99
/// RenegotiationInfo allows a Client/Server to
10-
/// communicate their renegotation support
10+
/// communicate their renegotiation support
1111
/// https://tools.ietf.org/html/rfc5746
1212
#[derive(Clone, Debug, PartialEq, Eq)]
1313
pub struct ExtensionRenegotiationInfo {

dtls/src/flight/flight4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ impl Flight for Flight4 {
269269
state.peer_certificates_verified = verified
270270
} else if !state.peer_certificates.is_empty() {
271271
// A certificate was received, but we haven't seen a CertificateVerify
272-
// keep reading until we receieve one
272+
// keep reading until we receive one
273273
return Err((None, None));
274274
}
275275

dtls/src/flight/flight5.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl Flight for Flight5 {
336336
}
337337

338338
if let Err((alert, err)) =
339-
initalize_cipher_suite(state, cache, cfg, &server_key_exchange, &merged).await
339+
initialize_cipher_suite(state, cache, cfg, &server_key_exchange, &merged).await
340340
{
341341
return Err((alert, err));
342342
}
@@ -599,7 +599,7 @@ impl Flight for Flight5 {
599599
Ok(pkts)
600600
}
601601
}
602-
async fn initalize_cipher_suite(
602+
async fn initialize_cipher_suite(
603603
state: &mut State,
604604
cache: &HandshakeCache,
605605
cfg: &HandshakeConfig,

dtls/src/fragment_buffer/fragment_buffer_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn test_fragment_buffer() -> Result<()> {
7878
0,
7979
),
8080
(
81-
"Multiple Handshakes in Signle Fragment",
81+
"Multiple Handshakes in Single Fragment",
8282
vec![vec![
8383
0x16, 0xfe, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
8484
0x30, /* record header */

dtls/src/fragment_buffer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn append_message(target_offset: u32, frags: &[Fragment], raw_message: &mut Vec<
139139
let fragment_end =
140140
f.handshake_header.fragment_offset + f.handshake_header.fragment_length;
141141

142-
// NB: Order here is imporant, the `f.handshake_header.fragment_length != 0`
142+
// NB: Order here is important, the `f.handshake_header.fragment_length != 0`
143143
// MUST come before the recursive call.
144144
if fragment_end != f.handshake_header.length
145145
&& f.handshake_header.fragment_length != 0

dtls/src/handshake/handshake_cache/handshake_cache_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ async fn test_handshake_cache_session_hash() -> Result<()> {
650650

651651
assert_eq!(
652652
verify_data, expected,
653-
"handshakeCacheSesssionHassh '{name}' exp: {expected:?} actual {verify_data:?}"
653+
"handshakeCacheSessionHassh '{name}' exp: {expected:?} actual {verify_data:?}"
654654
);
655655
}
656656

examples/examples/ice-restart/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cargo run --example ice-restart
1717
Open [http://localhost:8080](http://localhost:8080). This will automatically start a PeerConnection. This page will now prints stats about the PeerConnection
1818
and allow you to do an ICE Restart at anytime.
1919

20-
* `ICE Restart` is the button that causes a new offer to be made wih `iceRestart: true`.
20+
* `ICE Restart` is the button that causes a new offer to be made with `iceRestart: true`.
2121
* `ICE Connection States` will contain all the connection states the PeerConnection moves through.
2222
* `ICE Selected Pairs` will print the selected pair every 3 seconds. Note how the uFrag/uPwd/Port change everytime you start the Restart process.
2323
* `Inbound DataChannel Messages` containing the current time sent by the Pion process every 3 seconds.

examples/examples/insertable-streams/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This example modifies the video with a single-byte XOR cipher before sending, an
55
decrypts in Javascript.
66

77
insertable-streams allows the browser to process encoded video. You could implement
8-
E2E encyption, add metadata or insert a completely different video feed!
8+
E2E encryption, add metadata or insert a completely different video feed!
99

1010
## Instructions
1111

ice/CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ This release was released in error and contains no changes from 0.8.0.
4141

4242
## v0.8.0
4343

44-
* 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).
45-
* Incresed serde's minimum version to 1.0.102 [#243 Fixes for cargo minimal-versions](https://github.com/webrtc-rs/webrtc/pull/243) contributed by [algesten](https://github.com/algesten)
44+
* 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).
45+
* Increased serde's minimum version to 1.0.102 [#243 Fixes for cargo minimal-versions](https://github.com/webrtc-rs/webrtc/pull/243) contributed by [algesten](https://github.com/algesten)
4646

4747
## Prior to 0.8.0
4848

ice/src/agent/agent_config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub struct AgentConfig {
119119
/// It is used along with nat1to1ips to specify which candidate type the 1:1 NAT IP addresses
120120
/// should be mapped to. If unspecified or CandidateTypeHost, nat1to1ips are used to replace
121121
/// host candidate IPs. If CandidateTypeServerReflexive, it will insert a srflx candidate (as
122-
/// if it was dervied from a STUN server) with its port number being the one for the actual host
122+
/// if it was derived from a STUN server) with its port number being the one for the actual host
123123
/// candidate. Other values will result in an error.
124124
pub nat_1to1_ip_candidate_type: CandidateType,
125125

ice/src/agent/agent_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,7 @@ async fn test_agent_restart_both_side() -> Result<()> {
19081908
let _ = a_connected.recv().await;
19091909
let _ = b_connected.recv().await;
19101910

1911-
// Assert that we have new candiates each time
1911+
// Assert that we have new candidates each time
19121912
assert_ne!(
19131913
conn_afirst_candidates,
19141914
generate_candidate_address_strings(agent_a.get_local_candidates().await)

ice/src/external_ip_mapper/external_ip_mapper_test.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ fn test_external_ip_mapper_new_external_ip_mapper() -> Result<()> {
8686
);
8787
assert!(result.is_err(), "should fail");
8888

89-
// Invalide external IP string
89+
// Invalid external IP string
9090
let result = ExternalIpMapper::new(CandidateType::ServerReflexive, &["bad.2.3.4".to_owned()]);
9191
assert!(result.is_err(), "should fail");
9292

93-
// Invalide local IP string
93+
// Invalid local IP string
9494
let result = ExternalIpMapper::new(
9595
CandidateType::ServerReflexive,
9696
&["1.2.3.4/10.0.0.bad".to_owned()],
@@ -182,7 +182,7 @@ fn test_external_ip_mapper_find_external_ip_without_explicit_local_ip() -> Resul
182182
assert_eq!(ext_ip.to_string(), "1.2.3.4", "should match");
183183

184184
// find external IPv6
185-
let ext_ip = m.find_external_ip("fe80::0001")?; // use '0001' instead of '1' on purpse
185+
let ext_ip = m.find_external_ip("fe80::0001")?; // use '0001' instead of '1' on purpose
186186
assert_eq!(ext_ip.to_string(), "2200::1", "should match");
187187

188188
// Bad local IP string
@@ -217,10 +217,10 @@ fn test_external_ip_mapper_find_external_ip_with_explicit_local_ip() -> Result<(
217217
assert!(result.is_err(), "should fail");
218218

219219
// find external IPv6
220-
let ext_ip = m.find_external_ip("fe80::0001")?; // use '0001' instead of '1' on purpse
220+
let ext_ip = m.find_external_ip("fe80::0001")?; // use '0001' instead of '1' on purpose
221221
assert_eq!(ext_ip.to_string(), "2200::1", "should match");
222222

223-
let ext_ip = m.find_external_ip("fe80::0002")?; // use '0002' instead of '2' on purpse
223+
let ext_ip = m.find_external_ip("fe80::0002")?; // use '0002' instead of '2' on purpose
224224
assert_eq!(ext_ip.to_string(), "2200::2", "should match");
225225

226226
let result = m.find_external_ip("fe80::3");

ice/src/udp_mux/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub struct UDPMuxDefault {
7777
// Close sender
7878
closed_watch_tx: Mutex<Option<watch::Sender<()>>>,
7979

80-
/// Close reciever
80+
/// Close receiver
8181
closed_watch_rx: watch::Receiver<()>,
8282
}
8383

@@ -183,7 +183,7 @@ impl UDPMuxDefault {
183183

184184
let conn = match conn {
185185
// If we couldn't find the connection based on source address, see if
186-
// this is a STUN mesage and if so if we can find the connection based on ufrag.
186+
// this is a STUN message and if so if we can find the connection based on ufrag.
187187
None if is_stun_message(&buffer) => {
188188
loop_self.conn_from_stun_message(&buffer, &addr).await
189189
}

ice/src/udp_mux/udp_mux_test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Network {
2626
}
2727
}
2828

29-
/// Connnect ip from the "remote".
29+
/// Connect ip from the "remote".
3030
fn connect_ip(self, port: u16) -> String {
3131
match self {
3232
Network::Ipv4 => format!("127.0.0.1:{port}"),
@@ -174,7 +174,7 @@ async fn test_mux_connection(
174174
);
175175

176176
// These bytes should be dropped
177-
remote_connection.send("Droppped bytes".as_bytes()).await?;
177+
remote_connection.send("Dropped bytes".as_bytes()).await?;
178178

179179
sleep(Duration::from_millis(1)).await;
180180

interceptor/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
* [#14 Don't panic on seqnum rollover](https://github.com/webrtc-rs/interceptor/pull/14) contributed by by [@pthatcher](https://github.com/pthatcher).
1717
* Add stats interceptor. Contributed by [@k0nserv](https://github.com/k0nserv) in [#277](https://github.com/webrtc-rs/webrtc/pull/277/) and [#225](https://github.com/webrtc-rs/webrtc/pull/225).
18-
* 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).
18+
* 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).
1919

2020
## Prior to 0.8.0
2121

interceptor/src/mock/mock_interceptor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub type UnbindRemoteStreamFn =
4343
pub type CloseFn =
4444
Box<dyn (Fn() -> Pin<Box<dyn Future<Output = Result<()>> + Send + Sync>>) + Send + Sync>;
4545

46-
/// MockInterceptor is an mock Interceptor fot testing.
46+
/// MockInterceptor is an mock Interceptor for testing.
4747
#[derive(Default)]
4848
pub struct MockInterceptor {
4949
pub bind_rtcp_reader_fn: Option<BindRtcpReaderFn>,

interceptor/src/mock/mock_stream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl MockStream {
209209
rtp_in_modified_rx.recv().await
210210
}
211211

212-
/// cose closes the stream and the underlying interceptor
212+
/// close closes the stream and the underlying interceptor
213213
pub async fn close(&self) -> Result<()> {
214214
{
215215
let mut rtcp_in_tx = self.rtcp_in_tx.lock().await;

interceptor/src/stats/interceptor.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ enum StatsUpdate {
6868
/// An extended sequence number sent in an SR.
6969
OutboundSRExtSeqNum { seq_num: u32 },
7070
/// Stats collected from received Receiver Reports i.e. where we have an outbound RTP stream.
71-
InboundRecieverReport {
71+
InboundReceiverReport {
7272
ext_seq_num: u32,
7373
total_lost: u32,
7474
jitter: u32,
7575
rtt_ms: Option<f64>,
7676
fraction_lost: u8,
7777
},
78-
/// Stats collected from recieved Sender Reports i.e. where we have an inbound RTP stream.
78+
/// Stats collected from received Sender Reports i.e. where we have an inbound RTP stream.
7979
InboundSenderRerport {
8080
packets_and_bytes_sent: Option<(u32, u32)>,
8181
rtt_ms: Option<f64>,
@@ -262,7 +262,7 @@ fn handle_stats_update(ssrc_stats: &mut StatsContainer, ssrc: u32, update: Stats
262262
stats.record_sr_ext_seq_num(seq_num);
263263
stats.mark_updated();
264264
}
265-
StatsUpdate::InboundRecieverReport {
265+
StatsUpdate::InboundReceiverReport {
266266
ext_seq_num,
267267
total_lost,
268268
jitter,
@@ -565,7 +565,7 @@ where
565565
let futures = receiver_reports.into_iter().map(|rr| {
566566
self.tx.send(Message::StatUpdate {
567567
ssrc,
568-
update: StatsUpdate::InboundRecieverReport {
568+
update: StatsUpdate::InboundReceiverReport {
569569
ext_seq_num: rr.ext_seq_num,
570570
total_lost: rr.total_lost,
571571
jitter: rr.jitter,
@@ -1183,7 +1183,7 @@ mod test {
11831183
assert_eq!(recv_snapshot.remote_bytes_sent(), 10351);
11841184
let rtt_ms = recv_snapshot
11851185
.remote_round_trip_time()
1186-
.expect("After reciving SR and DLRR we should have a round trip time ");
1186+
.expect("After receiving SR and DLRR we should have a round trip time ");
11871187
assert_feq!(rtt_ms, 6125.0);
11881188
assert_eq!(recv_snapshot.remote_reports_sent(), 2);
11891189
assert_eq!(recv_snapshot.remote_round_trip_time_measurements(), 1);

0 commit comments

Comments
 (0)