Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelYvon committed Mar 4, 2024
1 parent 82471e9 commit 9695f97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions onvif/src/discovery/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
mod network_enumeration;

use crate::discovery::network_enumeration::enumerate_network_v4;
use futures_core::stream::Stream;
use schema::ws_discovery::{probe, probe_matches};
use std::iter::Iterator;
use std::{
collections::HashSet,
fmt::{Debug, Formatter},
Expand Down Expand Up @@ -155,7 +157,7 @@ impl DiscoveryBuilder {
futures::future::join_all(unicast_requests.iter().map(
|(sock, addr, device_sender, payload, message_id)| async move {
sock.send_to(payload, addr).await.ok()?;
let (xml, _) = recv_string(&sock).await.ok()?;
let (xml, _) = recv_string(sock).await.ok()?;

debug!("Probe match XML: {}", xml);

Expand Down Expand Up @@ -390,11 +392,6 @@ fn build_probe() -> probe::Envelope {
}
}

use crate::discovery::network_enumeration::enumerate_network_v4;
use std::iter::Iterator;
use std::net::Ipv6Addr;
use tokio_stream::StreamExt;

#[tokio::test]
async fn test_unicast() {
let devices = DiscoveryBuilder::default()
Expand Down
2 changes: 1 addition & 1 deletion onvif/src/discovery/network_enumeration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::net::Ipv4Addr;
fn octets_to_u32(octets: [u8; 4]) -> u32 {
(octets[0] as u32) << (3 * 8)
| (octets[1] as u32) << (2 * 8)
| (octets[2] as u32) << (1 * 8)
| (octets[2] as u32) << 8
| (octets[3] as u32)
}

Expand Down

0 comments on commit 9695f97

Please sign in to comment.