Skip to content

Commit

Permalink
style: remove for
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemeowx2 committed Aug 30, 2023
1 parent e7eda79 commit ba44f2d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions rd-std/src/sniffer/sni_sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ impl rd_interface::ITcpStream for SnifferTcp {
fn get_sni(bytes: &[u8]) -> Option<String> {

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Cross compile (armv7-unknown-linux-gnueabihf)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Cross compile (aarch64-unknown-linux-musl)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Cross compile (mipsel-unknown-linux-musl)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Cross compile (i686-unknown-linux-musl)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Cross compile (x86_64-unknown-linux-musl)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Build (windows-latest)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

function `get_sni` is never used

Check warning on line 157 in rd-std/src/sniffer/sni_sniffer.rs

View workflow job for this annotation

GitHub Actions / Build (macos-latest)

function `get_sni` is never used
let (_, res) = parse_tls_plaintext(&bytes).ok()?;

for host_name in res
.msg
res.msg
.into_iter()
.filter_map(|m| match m {
TlsMessage::Handshake(TlsMessageHandshake::ClientHello(ch)) => ch.ext,
Expand All @@ -180,11 +179,8 @@ fn get_sni(bytes: &[u8]) -> Option<String> {
}
})
.filter_map(|data| std::str::from_utf8(data).ok())
{
return Some(host_name.to_string());
}

None
.map(ToString::to_string)
.next()
}

#[cfg(test)]
Expand Down

0 comments on commit ba44f2d

Please sign in to comment.