breaking: bump msrv to 1.91.0
This commit is contained in:
@@ -10,7 +10,7 @@ keywords = ["adb", "android", "tcp", "usb"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/cocool97/adb_client"
|
||||
version = "2.1.18"
|
||||
rust-version = "1.85.1"
|
||||
rust-version = "1.91.0"
|
||||
|
||||
# To build locally when working on a new release
|
||||
[patch.crates-io]
|
||||
|
||||
@@ -24,12 +24,12 @@ num-bigint = { version = "0.8.6", package = "num-bigint-dig" }
|
||||
num-traits = { version = "0.2.19" }
|
||||
quick-protobuf = { version = "0.8.1" }
|
||||
rand = { version = "0.9.2" }
|
||||
rcgen = { version = "0.14.5" }
|
||||
rcgen = { version = "0.14.6" }
|
||||
regex = { version = "1.12.2", features = ["perf", "std", "unicode"] }
|
||||
rsa = { version = "0.9.9" }
|
||||
rusb = { version = "0.9.4", features = ["vendored"] }
|
||||
rustls = { version = "0.23.35" }
|
||||
rustls-pki-types = { version = "1.13.1" }
|
||||
rustls-pki-types = { version = "1.13.2" }
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
serde_repr = { version = "0.1.20" }
|
||||
sha1 = { version = "0.10.6", features = ["oid"] }
|
||||
|
||||
@@ -32,10 +32,11 @@ impl USBTransport {
|
||||
/// Only the first device with given `vendor_id` and `product_id` is returned.
|
||||
pub fn new(vendor_id: u16, product_id: u16) -> Result<Self> {
|
||||
for device in rusb::devices()?.iter() {
|
||||
if let Ok(descriptor) = device.device_descriptor() {
|
||||
if descriptor.vendor_id() == vendor_id && descriptor.product_id() == product_id {
|
||||
return Ok(Self::new_from_device(device));
|
||||
}
|
||||
if let Ok(descriptor) = device.device_descriptor()
|
||||
&& descriptor.vendor_id() == vendor_id
|
||||
&& descriptor.product_id() == product_id
|
||||
{
|
||||
return Ok(Self::new_from_device(device));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ use std::{ffi::OsStr, path::Path};
|
||||
use crate::{Result, RustADBError};
|
||||
|
||||
pub fn check_extension_is_apk<P: AsRef<Path>>(path: P) -> Result<()> {
|
||||
if let Some(extension) = path.as_ref().extension() {
|
||||
if ![OsStr::new("apk")].contains(&extension) {
|
||||
return Err(RustADBError::WrongFileExtension(format!(
|
||||
"{} is not an APK file",
|
||||
extension.to_string_lossy()
|
||||
)));
|
||||
}
|
||||
if let Some(extension) = path.as_ref().extension()
|
||||
&& ![OsStr::new("apk")].contains(&extension)
|
||||
{
|
||||
return Err(RustADBError::WrongFileExtension(format!(
|
||||
"{} is not an APK file",
|
||||
extension.to_string_lossy()
|
||||
)));
|
||||
}
|
||||
|
||||
log::debug!("Given file is an APK");
|
||||
|
||||
Reference in New Issue
Block a user