Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/chunks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

mod types;

pub use types::{Chunked, MissingObjectsInfo, Named};
pub use types::{Assemblable, Chunked, MissingObjectsInfo};

use std::sync::Arc;
use std::time::Duration;
Expand Down
8 changes: 4 additions & 4 deletions src/utils/chunks/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::utils::fs;
/// objects and their missing chunks.
pub type MissingObjectsInfo<'m, T> = (Vec<&'m Chunked<T>>, Vec<Chunk<'m>>);

/// A trait for objects that have a name.
pub trait Named {
/// A trait for objects that can be assembled via the `assemble_difs` endpoint.
pub trait Assemblable {
/// Returns the name of the object.
fn name(&self) -> &str;
}
Expand Down Expand Up @@ -87,9 +87,9 @@ where
}
}

impl<T> Named for Chunked<T>
impl<T> Assemblable for Chunked<T>
where
T: Named,
T: Assemblable,
{
fn name(&self) -> &str {
self.object().name()
Expand Down
6 changes: 3 additions & 3 deletions src/utils/dif_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::api::{
use crate::config::Config;
use crate::constants::{DEFAULT_MAX_DIF_SIZE, DEFAULT_MAX_WAIT};
use crate::utils::chunks::{
upload_chunks, BatchedSliceExt, Chunk, Chunked, ItemSize, MissingObjectsInfo, Named,
upload_chunks, Assemblable, BatchedSliceExt, Chunk, Chunked, ItemSize, MissingObjectsInfo,
ASSEMBLE_POLL_INTERVAL,
};
use crate::utils::dif::ObjectDifFeatures;
Expand Down Expand Up @@ -304,7 +304,7 @@ impl Display for DifMatch<'_> {
}
}

impl Named for DifMatch<'_> {
impl Assemblable for DifMatch<'_> {
/// A DIF's name is its file name.
fn name(&self) -> &str {
self.file_name()
Expand Down Expand Up @@ -1404,7 +1404,7 @@ fn poll_assemble<T>(
options: &DifUpload,
) -> Result<(Vec<DebugInfoFile>, bool)>
where
T: Display + Named,
T: Display + Assemblable,
Chunked<T>: IntoAssembleRequest,
{
let progress_style = ProgressStyle::default_bar().template(
Expand Down
Loading