diff --git a/src/command/commands.rs b/src/command/commands.rs index 1a4a556..1d1552a 100644 --- a/src/command/commands.rs +++ b/src/command/commands.rs @@ -149,14 +149,14 @@ impl Command for Update<'_> { /// Create placeholder files/directories. #[derive(Debug)] -pub struct CreatePlaceholders { +pub struct CreatePlaceholders<'a> { /// The placeholders to create. - pub placeholders: Vec, + pub placeholders: &'a mut [PlaceholderFile], /// The total amount of placeholders that are a child of the current directory. pub total: u64, } -impl Command for CreatePlaceholders { +impl Command for CreatePlaceholders<'_> { const OPERATION: CF_OPERATION_TYPE = CloudFilters::CF_OPERATION_TYPE_TRANSFER_PLACEHOLDERS; type Result = Vec>; @@ -203,7 +203,7 @@ impl Command for CreatePlaceholders { } } -impl Fallible for CreatePlaceholders { +impl Fallible for CreatePlaceholders<'_> { fn fail( connection_key: RawConnectionKey, transfer_key: RawTransferKey, diff --git a/src/filter/ticket.rs b/src/filter/ticket.rs index 267c9f6..febe9d7 100644 --- a/src/filter/ticket.rs +++ b/src/filter/ticket.rs @@ -82,7 +82,7 @@ impl FetchPlaceholders { /// The value returned is the final [Usn][crate::Usn] (and if they succeeded) after each placeholder is created. pub fn pass_with_placeholder( &self, - placeholders: Vec, + placeholders: &mut [PlaceholderFile], ) -> core::Result>> { command::CreatePlaceholders { total: placeholders.len() as _, diff --git a/src/placeholder.rs b/src/placeholder.rs index ea59d61..62da5d0 100644 --- a/src/placeholder.rs +++ b/src/placeholder.rs @@ -265,11 +265,7 @@ pub struct UpdateOptions<'a>(Update<'a>); impl<'a> UpdateOptions<'a> { /// Create a new [UpdateOptions][crate::UpdateOptions]. pub fn new() -> Self { - Self(Update { - mark_sync: false, - metadata: None, - blob: None, - }) + Self::default() } /// Marks the placeholder as synced. @@ -309,7 +305,11 @@ impl<'a> UpdateOptions<'a> { impl<'a> Default for UpdateOptions<'a> { fn default() -> Self { - Self::new() + Self(Update { + mark_sync: false, + metadata: None, + blob: None, + }) } }