mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
Clean feature-less build warnings
This commit is contained in:
@@ -180,7 +180,7 @@ impl Idevice {
|
|||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
/// Returns `IdeviceError` if transmission fails
|
/// Returns `IdeviceError` if transmission fails
|
||||||
async fn send_raw(&mut self, message: &[u8]) -> Result<(), IdeviceError> {
|
pub async fn send_raw(&mut self, message: &[u8]) -> Result<(), IdeviceError> {
|
||||||
self.send_raw_with_progress(message, |_| async {}, ()).await
|
self.send_raw_with_progress(message, |_| async {}, ()).await
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ impl Idevice {
|
|||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
/// Returns `IdeviceError` if transmission fails
|
/// Returns `IdeviceError` if transmission fails
|
||||||
async fn send_raw_with_progress<Fut, S>(
|
pub async fn send_raw_with_progress<Fut, S>(
|
||||||
&mut self,
|
&mut self,
|
||||||
message: &[u8],
|
message: &[u8],
|
||||||
callback: impl Fn(((usize, usize), S)) -> Fut,
|
callback: impl Fn(((usize, usize), S)) -> Fut,
|
||||||
@@ -233,7 +233,7 @@ impl Idevice {
|
|||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
/// Returns `IdeviceError` if reading fails or connection is closed prematurely
|
/// Returns `IdeviceError` if reading fails or connection is closed prematurely
|
||||||
async fn read_raw(&mut self, len: usize) -> Result<Vec<u8>, IdeviceError> {
|
pub async fn read_raw(&mut self, len: usize) -> Result<Vec<u8>, IdeviceError> {
|
||||||
if let Some(socket) = &mut self.socket {
|
if let Some(socket) = &mut self.socket {
|
||||||
let mut buf = vec![0; len];
|
let mut buf = vec![0; len];
|
||||||
socket.read_exact(&mut buf).await?;
|
socket.read_exact(&mut buf).await?;
|
||||||
@@ -253,7 +253,7 @@ impl Idevice {
|
|||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
/// Returns `IdeviceError` if reading fails
|
/// Returns `IdeviceError` if reading fails
|
||||||
async fn read_any(&mut self, max_size: u32) -> Result<Vec<u8>, IdeviceError> {
|
pub async fn read_any(&mut self, max_size: u32) -> Result<Vec<u8>, IdeviceError> {
|
||||||
if let Some(socket) = &mut self.socket {
|
if let Some(socket) = &mut self.socket {
|
||||||
let mut buf = vec![0; max_size as usize];
|
let mut buf = vec![0; max_size as usize];
|
||||||
let len = socket.read(&mut buf).await?;
|
let len = socket.read(&mut buf).await?;
|
||||||
|
|||||||
@@ -3,11 +3,7 @@
|
|||||||
//! Provides abstractions for establishing connections to iOS devices through different
|
//! Provides abstractions for establishing connections to iOS devices through different
|
||||||
//! transport mechanisms (TCP, USB, etc.).
|
//! transport mechanisms (TCP, USB, etc.).
|
||||||
|
|
||||||
use std::{
|
use std::{future::Future, pin::Pin};
|
||||||
future::Future,
|
|
||||||
net::{IpAddr, SocketAddr},
|
|
||||||
pin::Pin,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(feature = "tcp")]
|
#[cfg(feature = "tcp")]
|
||||||
use tokio::net::TcpStream;
|
use tokio::net::TcpStream;
|
||||||
@@ -51,7 +47,7 @@ pub trait IdeviceProvider: Unpin + Send + Sync + std::fmt::Debug {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TcpProvider {
|
pub struct TcpProvider {
|
||||||
/// IP address of the device
|
/// IP address of the device
|
||||||
pub addr: IpAddr,
|
pub addr: std::net::IpAddr,
|
||||||
/// Pairing file for secure communication
|
/// Pairing file for secure communication
|
||||||
pub pairing_file: PairingFile,
|
pub pairing_file: PairingFile,
|
||||||
/// Label identifying this connection
|
/// Label identifying this connection
|
||||||
@@ -74,7 +70,7 @@ impl IdeviceProvider for TcpProvider {
|
|||||||
let addr = self.addr;
|
let addr = self.addr;
|
||||||
let label = self.label.clone();
|
let label = self.label.clone();
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
let socket_addr = SocketAddr::new(addr, port);
|
let socket_addr = std::net::SocketAddr::new(addr, port);
|
||||||
let stream = TcpStream::connect(socket_addr).await?;
|
let stream = TcpStream::connect(socket_addr).await?;
|
||||||
Ok(Idevice::new(Box::new(stream), label))
|
Ok(Idevice::new(Box::new(stream), label))
|
||||||
})
|
})
|
||||||
@@ -153,4 +149,3 @@ impl IdeviceProvider for UsbmuxdProvider {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
//!
|
//!
|
||||||
//! Provides helper functions for working with Apple's Property List (PLIST) format,
|
//! Provides helper functions for working with Apple's Property List (PLIST) format,
|
||||||
//! including serialization and pretty-printing utilities.
|
//! including serialization and pretty-printing utilities.
|
||||||
|
#![allow(dead_code)] // functions might not be used by all features
|
||||||
|
|
||||||
use plist::Value;
|
use plist::Value;
|
||||||
|
|
||||||
@@ -125,4 +126,3 @@ fn print_plist(p: &Value, indentation: usize) -> String {
|
|||||||
_ => "Unknown".to_string(),
|
_ => "Unknown".to_string(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user