Skip to content

Commit

Permalink
fix!: typos (#490)
Browse files Browse the repository at this point in the history
* chore: fix typos

* ci: integrate typos checker

* fix: alls -> allocs

causes shadowing, but the shawoing makes perfect sense

* style: new line at eof
  • Loading branch information
LeoDog896 authored Sep 3, 2023
1 parent b0d5662 commit 487ea32
Show file tree
Hide file tree
Showing 89 changed files with 175 additions and 158 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
working-directory: "C:\\a\\webrtc\\webrtc"
run: cargo test --features metrics

rustfmt_and_clippy:
quality:
name: Check formatting style and run clippy
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -116,3 +116,5 @@ jobs:
with:
command: fmt
args: --all -- --check
- name: Check for typos
uses: crate-ci/typos@master
15 changes: 15 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[type.po]
extend-glob = ["*.csr"]
check-file = false

[default.extend-words]
# Additionals is important for WebRTC
additionals = "additionals"
# STAP-A for WebRTC
stap = "stap"
# MIS value
mis = "mis"
# datas is used a lot for plural.
datas = "datas"
# 2nd for second
2nd = "2nd"
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl_numeric_value_constraint!(setting: i64, constraint: u64);
impl_numeric_value_constraint!(setting: i64, constraint: f64);
impl_numeric_value_constraint!(setting: f64, constraint: u64);

// Specialized implementations for boolean value constraints of mis-matching
// Specialized implementations for boolean value constraints of mismatching
// and thus either "existence"-checked or ignored setting types:
macro_rules! impl_exists_value_constraint {
(settings: [$($s:ty),+], constraint: bool) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl_value_range_constraint!(setting: i64, constraint: u64);
impl_value_range_constraint!(setting: i64, constraint: f64);
impl_value_range_constraint!(setting: f64, constraint: u64);

// Specialized implementations for non-boolean value constraints of mis-matching,
// Specialized implementations for non-boolean value constraints of mismatching,
// and thus ignored setting types:
macro_rules! impl_ignored_value_range_constraint {
(settings: [$($s:ty),+], constraint: $c:ty) => {
Expand Down
2 changes: 1 addition & 1 deletion constraints/src/algorithms/select_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ where
// # Important
// Instead of return just ONE settings instance "with the smallest fitness distance, as calculated in step 3"
// we instead return ALL settings instances "with the smallest fitness distance, as calculated in step 3"
// and leave tie-breaking to the User Agent in a seperate step:
// and leave tie-breaking to the User Agent in a separate step:
Ok(select_optimal_candidates(candidates))
}

Expand Down
2 changes: 1 addition & 1 deletion data/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
## v0.5.0

* [#16 [PollDataChannel] reset shutdown_fut future after done](https://github.com/webrtc-rs/data/pull/16) by [@melekes](https://github.com/melekes).
* 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).
* 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).

## Prior to 0.4.0

Expand Down
2 changes: 1 addition & 1 deletion dtls/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
## v0.6.0

* [#254 [DTLS] Add NamedCurve::P384](https://github.com/webrtc-rs/webrtc/pull/254) contributed by [neonphog](https://github.com/neonphog)
* 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).
* 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).
* 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)

## Prior to 0.6.0
Expand Down
6 changes: 3 additions & 3 deletions dtls/src/conn/conn_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2374,7 +2374,7 @@ async fn send_client_hello(
// a ClientHello contained that extension or not
#[cfg(not(target_os = "windows"))] // this times out in CI on windows.
#[tokio::test]
async fn test_renegotation_info() -> Result<()> {
async fn test_renegotiation_info() -> Result<()> {
let mut resp = vec![0u8; 1024];

let tests = vec![
Expand Down Expand Up @@ -2440,13 +2440,13 @@ async fn test_renegotation_info() -> Result<()> {
}
};

let got_negotation_info = server_hello
let got_negotiation_info = server_hello
.extensions
.iter()
.any(|v| matches!(v, Extension::RenegotiationInfo(_)));

assert!(
got_negotation_info,
got_negotiation_info,
"{name}: Received ServerHello without RenegotiationInfo"
);

Expand Down
2 changes: 1 addition & 1 deletion dtls/src/extension/renegotiation_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::error::Error::ErrInvalidPacketLength;
const RENEGOTIATION_INFO_HEADER_SIZE: usize = 5;

/// RenegotiationInfo allows a Client/Server to
/// communicate their renegotation support
/// communicate their renegotiation support
/// https://tools.ietf.org/html/rfc5746
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ExtensionRenegotiationInfo {
Expand Down
2 changes: 1 addition & 1 deletion dtls/src/flight/flight4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ impl Flight for Flight4 {
state.peer_certificates_verified = verified
} else if !state.peer_certificates.is_empty() {
// A certificate was received, but we haven't seen a CertificateVerify
// keep reading until we receieve one
// keep reading until we receive one
return Err((None, None));
}

Expand Down
4 changes: 2 additions & 2 deletions dtls/src/flight/flight5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ impl Flight for Flight5 {
}

if let Err((alert, err)) =
initalize_cipher_suite(state, cache, cfg, &server_key_exchange, &merged).await
initialize_cipher_suite(state, cache, cfg, &server_key_exchange, &merged).await
{
return Err((alert, err));
}
Expand Down Expand Up @@ -599,7 +599,7 @@ impl Flight for Flight5 {
Ok(pkts)
}
}
async fn initalize_cipher_suite(
async fn initialize_cipher_suite(
state: &mut State,
cache: &HandshakeCache,
cfg: &HandshakeConfig,
Expand Down
2 changes: 1 addition & 1 deletion dtls/src/fragment_buffer/fragment_buffer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn test_fragment_buffer() -> Result<()> {
0,
),
(
"Multiple Handshakes in Signle Fragment",
"Multiple Handshakes in Single Fragment",
vec![vec![
0x16, 0xfe, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x30, /* record header */
Expand Down
2 changes: 1 addition & 1 deletion dtls/src/fragment_buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fn append_message(target_offset: u32, frags: &[Fragment], raw_message: &mut Vec<
let fragment_end =
f.handshake_header.fragment_offset + f.handshake_header.fragment_length;

// NB: Order here is imporant, the `f.handshake_header.fragment_length != 0`
// NB: Order here is important, the `f.handshake_header.fragment_length != 0`
// MUST come before the recursive call.
if fragment_end != f.handshake_header.length
&& f.handshake_header.fragment_length != 0
Expand Down
2 changes: 1 addition & 1 deletion dtls/src/handshake/handshake_cache/handshake_cache_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ async fn test_handshake_cache_session_hash() -> Result<()> {

assert_eq!(
verify_data, expected,
"handshakeCacheSesssionHassh '{name}' exp: {expected:?} actual {verify_data:?}"
"handshakeCacheSessionHassh '{name}' exp: {expected:?} actual {verify_data:?}"
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/examples/ice-restart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cargo run --example ice-restart
Open [http://localhost:8080](http://localhost:8080). This will automatically start a PeerConnection. This page will now prints stats about the PeerConnection
and allow you to do an ICE Restart at anytime.

* `ICE Restart` is the button that causes a new offer to be made wih `iceRestart: true`.
* `ICE Restart` is the button that causes a new offer to be made with `iceRestart: true`.
* `ICE Connection States` will contain all the connection states the PeerConnection moves through.
* `ICE Selected Pairs` will print the selected pair every 3 seconds. Note how the uFrag/uPwd/Port change everytime you start the Restart process.
* `Inbound DataChannel Messages` containing the current time sent by the Pion process every 3 seconds.
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/insertable-streams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This example modifies the video with a single-byte XOR cipher before sending, an
decrypts in Javascript.

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

## Instructions

Expand Down
4 changes: 2 additions & 2 deletions ice/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ This release was released in error and contains no changes from 0.8.0.

## v0.8.0

* 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).
* 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)
* 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).
* 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)

## Prior to 0.8.0

Expand Down
2 changes: 1 addition & 1 deletion ice/src/agent/agent_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub struct AgentConfig {
/// It is used along with nat1to1ips to specify which candidate type the 1:1 NAT IP addresses
/// should be mapped to. If unspecified or CandidateTypeHost, nat1to1ips are used to replace
/// host candidate IPs. If CandidateTypeServerReflexive, it will insert a srflx candidate (as
/// if it was dervied from a STUN server) with its port number being the one for the actual host
/// if it was derived from a STUN server) with its port number being the one for the actual host
/// candidate. Other values will result in an error.
pub nat_1to1_ip_candidate_type: CandidateType,

Expand Down
2 changes: 1 addition & 1 deletion ice/src/agent/agent_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ async fn test_agent_restart_both_side() -> Result<()> {
let _ = a_connected.recv().await;
let _ = b_connected.recv().await;

// Assert that we have new candiates each time
// Assert that we have new candidates each time
assert_ne!(
conn_afirst_candidates,
generate_candidate_address_strings(agent_a.get_local_candidates().await)
Expand Down
10 changes: 5 additions & 5 deletions ice/src/external_ip_mapper/external_ip_mapper_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ fn test_external_ip_mapper_new_external_ip_mapper() -> Result<()> {
);
assert!(result.is_err(), "should fail");

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

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

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

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

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

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

let result = m.find_external_ip("fe80::3");
Expand Down
4 changes: 2 additions & 2 deletions ice/src/udp_mux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub struct UDPMuxDefault {
// Close sender
closed_watch_tx: Mutex<Option<watch::Sender<()>>>,

/// Close reciever
/// Close receiver
closed_watch_rx: watch::Receiver<()>,
}

Expand Down Expand Up @@ -183,7 +183,7 @@ impl UDPMuxDefault {

let conn = match conn {
// If we couldn't find the connection based on source address, see if
// this is a STUN mesage and if so if we can find the connection based on ufrag.
// this is a STUN message and if so if we can find the connection based on ufrag.
None if is_stun_message(&buffer) => {
loop_self.conn_from_stun_message(&buffer, &addr).await
}
Expand Down
4 changes: 2 additions & 2 deletions ice/src/udp_mux/udp_mux_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl Network {
}
}

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

// These bytes should be dropped
remote_connection.send("Droppped bytes".as_bytes()).await?;
remote_connection.send("Dropped bytes".as_bytes()).await?;

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

Expand Down
2 changes: 1 addition & 1 deletion interceptor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

* [#14 Don't panic on seqnum rollover](https://github.com/webrtc-rs/interceptor/pull/14) contributed by by [@pthatcher](https://github.com/pthatcher).
* 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).
* 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).
* 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).

## Prior to 0.8.0

Expand Down
2 changes: 1 addition & 1 deletion interceptor/src/mock/mock_interceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub type UnbindRemoteStreamFn =
pub type CloseFn =
Box<dyn (Fn() -> Pin<Box<dyn Future<Output = Result<()>> + Send + Sync>>) + Send + Sync>;

/// MockInterceptor is an mock Interceptor fot testing.
/// MockInterceptor is an mock Interceptor for testing.
#[derive(Default)]
pub struct MockInterceptor {
pub bind_rtcp_reader_fn: Option<BindRtcpReaderFn>,
Expand Down
2 changes: 1 addition & 1 deletion interceptor/src/mock/mock_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl MockStream {
rtp_in_modified_rx.recv().await
}

/// cose closes the stream and the underlying interceptor
/// close closes the stream and the underlying interceptor
pub async fn close(&self) -> Result<()> {
{
let mut rtcp_in_tx = self.rtcp_in_tx.lock().await;
Expand Down
10 changes: 5 additions & 5 deletions interceptor/src/stats/interceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ enum StatsUpdate {
/// An extended sequence number sent in an SR.
OutboundSRExtSeqNum { seq_num: u32 },
/// Stats collected from received Receiver Reports i.e. where we have an outbound RTP stream.
InboundRecieverReport {
InboundReceiverReport {
ext_seq_num: u32,
total_lost: u32,
jitter: u32,
rtt_ms: Option<f64>,
fraction_lost: u8,
},
/// Stats collected from recieved Sender Reports i.e. where we have an inbound RTP stream.
/// Stats collected from received Sender Reports i.e. where we have an inbound RTP stream.
InboundSenderRerport {
packets_and_bytes_sent: Option<(u32, u32)>,
rtt_ms: Option<f64>,
Expand Down Expand Up @@ -262,7 +262,7 @@ fn handle_stats_update(ssrc_stats: &mut StatsContainer, ssrc: u32, update: Stats
stats.record_sr_ext_seq_num(seq_num);
stats.mark_updated();
}
StatsUpdate::InboundRecieverReport {
StatsUpdate::InboundReceiverReport {
ext_seq_num,
total_lost,
jitter,
Expand Down Expand Up @@ -565,7 +565,7 @@ where
let futures = receiver_reports.into_iter().map(|rr| {
self.tx.send(Message::StatUpdate {
ssrc,
update: StatsUpdate::InboundRecieverReport {
update: StatsUpdate::InboundReceiverReport {
ext_seq_num: rr.ext_seq_num,
total_lost: rr.total_lost,
jitter: rr.jitter,
Expand Down Expand Up @@ -1183,7 +1183,7 @@ mod test {
assert_eq!(recv_snapshot.remote_bytes_sent(), 10351);
let rtt_ms = recv_snapshot
.remote_round_trip_time()
.expect("After reciving SR and DLRR we should have a round trip time ");
.expect("After receiving SR and DLRR we should have a round trip time ");
assert_feq!(rtt_ms, 6125.0);
assert_eq!(recv_snapshot.remote_reports_sent(), 2);
assert_eq!(recv_snapshot.remote_round_trip_time_measurements(), 1);
Expand Down
Loading

0 comments on commit 487ea32

Please sign in to comment.