Update iroh and sd-cloud-schema

- Fix usage of deprecated functions
 - Implement clippy beta suggestions
This commit is contained in:
Vítor Vasconcellos
2024-10-21 19:44:08 -03:00
parent 177763c536
commit 2fa90d6463
19 changed files with 26 additions and 21 deletions

BIN
Cargo.lock generated
View File

Binary file not shown.

View File

@@ -20,7 +20,7 @@ rust-version = "1.81"
[workspace.dependencies]
# First party dependencies
sd-cloud-schema = { git = "https://github.com/spacedriveapp/cloud-services-schema", rev = "54622014c9" }
sd-cloud-schema = { git = "https://github.com/spacedriveapp/cloud-services-schema", rev = "bbc69c5cb2" }
# Third party dependencies used by one or more of our crates
async-channel = "2.3"

View File

@@ -39,7 +39,7 @@ zeroize = { workspace = true }
# External dependencies
anyhow = "1.0.86"
dashmap = "6.1.0"
iroh-net = { version = "0.26", features = ["discovery-local-network", "iroh-relay"] }
iroh-net = { version = "0.27", features = ["discovery-local-network", "iroh-relay"] }
paste = "=1.0.15"
quic-rpc = { version = "0.12.1", features = ["quinn-transport"] }
quinn = { package = "iroh-quinn", version = "0.11" }

View File

@@ -132,7 +132,7 @@ async fn connect_and_send_notification(
) -> Result<(), Error> {
let client = Client::new(RpcClient::new(QuinnConnection::<Service>::from_connection(
endpoint
.connect_by_node_id(*connection_id, CloudP2PALPN::LATEST)
.connect(*connection_id, CloudP2PALPN::LATEST)
.await
.map_err(Error::ConnectToCloudP2PNode)?,
)));

View File

@@ -601,7 +601,7 @@ async fn connect_to_first_available_client(
) -> Result<Client<QuinnConnection<Service>, Service>, CloudP2PError> {
for (device_pub_id, device_connection_id) in devices_in_group {
if let Ok(connection) = endpoint
.connect_by_node_id(*device_connection_id, CloudP2PALPN::LATEST)
.connect(*device_connection_id, CloudP2PALPN::LATEST)
.await
.map_err(
|e| error!(?e, %device_pub_id, "Failed to connect to authorizor device candidate"),

View File

@@ -374,7 +374,7 @@ impl FileIdentifier {
self.last_orphan_file_path_id = None;
self.dispatch_deep_identifier_tasks(
&maybe_sub_iso_file_path,
maybe_sub_iso_file_path.as_ref(),
ctx,
device_id,
dispatcher,
@@ -419,7 +419,7 @@ impl FileIdentifier {
self.last_orphan_file_path_id = None;
self.dispatch_deep_identifier_tasks(
&maybe_sub_iso_file_path,
maybe_sub_iso_file_path.as_ref(),
ctx,
device_id,
dispatcher,
@@ -433,7 +433,7 @@ impl FileIdentifier {
Phase::SearchingOrphans => {
self.dispatch_deep_identifier_tasks(
&maybe_sub_iso_file_path,
maybe_sub_iso_file_path.as_ref(),
ctx,
device_id,
dispatcher,
@@ -752,7 +752,7 @@ impl FileIdentifier {
async fn dispatch_deep_identifier_tasks<OuterCtx: OuterContext>(
&mut self,
maybe_sub_iso_file_path: &Option<IsolatedFilePathData<'static>>,
maybe_sub_iso_file_path: Option<&IsolatedFilePathData<'static>>,
ctx: &impl JobContext<OuterCtx>,
device_id: device::id::Type,
dispatcher: &JobTaskDispatcher,

View File

@@ -176,7 +176,7 @@ fn orphan_path_filters_shallow(
fn orphan_path_filters_deep(
location_id: location::id::Type,
file_path_id: Option<file_path::id::Type>,
maybe_sub_iso_file_path: &Option<IsolatedFilePathData<'_>>,
maybe_sub_iso_file_path: Option<&IsolatedFilePathData<'_>>,
) -> Vec<file_path::WhereParam> {
sd_utils::chain_optional_iter(
[

View File

@@ -220,7 +220,7 @@ async fn dispatch_media_data_extractor_tasks(
async fn dispatch_thumbnailer_tasks(
parent_iso_file_path: &IsolatedFilePathData<'_>,
should_regenerate: bool,
location_path: &PathBuf,
location_path: &Path,
dispatcher: &BaseTaskDispatcher<Error>,
ctx: &impl OuterContext,
) -> Result<Vec<TaskHandle<Error>>, Error> {

View File

@@ -60,7 +60,7 @@ impl<'de> Deserialize<'de> for RulePerKind {
struct FieldsVisitor;
impl<'de> de::Visitor<'de> for FieldsVisitor {
impl de::Visitor<'_> for FieldsVisitor {
type Value = Fields;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

View File

@@ -338,7 +338,7 @@ impl Clone for CasId<'_> {
}
}
impl<'cas_id> CasId<'cas_id> {
impl CasId<'_> {
#[must_use]
pub fn as_str(&self) -> &str {
self.0.as_ref()

View File

@@ -121,6 +121,7 @@ impl InvalidRequests {
}
/// `invalidate_query` is a macro which stores a list of all of it's invocations so it can ensure all of the queries match the queries attached to the router.
///
/// This allows invalidate to be type-safe even when the router keys are stringly typed.
/// ```ignore
/// invalidate_query!(

View File

@@ -22,7 +22,10 @@ pub(crate) struct LibraryArgs<T> {
pub(crate) struct LibraryArgsLike;
impl MwArgMapper for LibraryArgsLike {
type Input<T> = LibraryArgs<T> where T: Type + DeserializeOwned + 'static;
type Input<T>
= LibraryArgs<T>
where
T: Type + DeserializeOwned + 'static;
type State = Uuid;
fn map<T: Serialize + DeserializeOwned + Type + 'static>(

View File

@@ -230,7 +230,7 @@ impl<'a> Bomb<'a> {
}
}
impl<'a> Drop for Bomb<'a> {
impl Drop for Bomb<'_> {
fn drop(&mut self) {
self.0.store(false, Ordering::Relaxed);
}

View File

@@ -40,6 +40,7 @@ uuid = { workspace = true, features = ["serde", "v4"] }
# Note: half and ndarray version must be the same as used in ort
half = { version = "2.4", features = ['num-traits'] }
ndarray = "0.15"
ort-sys = '=2.0.0-rc.0' # lock sys crate to the same version as ort
url = '2.5'
# Microsoft does not provide a release for osx-gpu. See: https://github.com/microsoft/onnxruntime/releases

View File

@@ -87,7 +87,7 @@ impl ConstantTimeEq for String {
}
}
impl<'a> ConstantTimeEq for &'a str {
impl ConstantTimeEq for &str {
fn ct_eq(&self, rhs: &Self) -> Choice {
// Here we are just able to convert both values to bytes and use the
// appropriate methods to compare the two in constant-time.

View File

@@ -87,7 +87,7 @@ pub struct FFmpegDictIter<'a> {
_lifetime: std::marker::PhantomData<&'a ()>,
}
impl<'a> Iterator for FFmpegDictIter<'a> {
impl Iterator for FFmpegDictIter<'_> {
type Item = (String, Option<String>);
fn next(&mut self) -> Option<(String, Option<String>)> {

View File

@@ -159,7 +159,7 @@ impl serde::Serialize for ConvertibleExtension {
struct ExtensionVisitor;
#[cfg(feature = "serde")]
impl<'de> serde::de::Visitor<'de> for ExtensionVisitor {
impl serde::de::Visitor<'_> for ExtensionVisitor {
type Value = ConvertibleExtension;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

View File

@@ -77,7 +77,7 @@ impl serde::Serialize for MediaDate {
struct MediaDateVisitor;
impl<'de> Visitor<'de> for MediaDateVisitor {
impl Visitor<'_> for MediaDateVisitor {
type Value = MediaDate;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

View File

@@ -28,7 +28,7 @@ impl<'a, T: Clone> SmartWriteGuard<'a, T> {
}
}
impl<'a, T> Deref for SmartWriteGuard<'a, T> {
impl<T> Deref for SmartWriteGuard<'_, T> {
type Target = T;
fn deref(&self) -> &Self::Target {
@@ -36,13 +36,13 @@ impl<'a, T> Deref for SmartWriteGuard<'a, T> {
}
}
impl<'a, T> DerefMut for SmartWriteGuard<'a, T> {
impl<T> DerefMut for SmartWriteGuard<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.lock
}
}
impl<'a, T> Drop for SmartWriteGuard<'a, T> {
impl<T> Drop for SmartWriteGuard<'_, T> {
fn drop(&mut self) {
(self.save)(
self.p2p,