Skip to content

Commit e22107b

Browse files
ref(chunks): Rename Named trait to Assemblable
Rename the `Named` trait to `Assemblable`, in preparation for adding another method to get the Debug ID. We will need to be able to get the DebugID anywhere where we prepare a call to the assemble endpoint, and this is also the only place we need to have a name. So, it makes sense to have a single trait for both.
1 parent c1aab98 commit e22107b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/utils/chunks/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
mod types;
99

10-
pub use types::{Chunked, MissingObjectsInfo, Named};
10+
pub use types::{Assemblable, Chunked, MissingObjectsInfo};
1111

1212
use std::sync::Arc;
1313
use std::time::Duration;

src/utils/chunks/types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use crate::utils::fs;
1212
/// objects and their missing chunks.
1313
pub type MissingObjectsInfo<'m, T> = (Vec<&'m Chunked<T>>, Vec<Chunk<'m>>);
1414

15-
/// A trait for objects that have a name.
16-
pub trait Named {
15+
/// A trait for objects that can be assembled via the `assemble_difs` endpoint.
16+
pub trait Assemblable {
1717
/// Returns the name of the object.
1818
fn name(&self) -> &str;
1919
}
@@ -87,9 +87,9 @@ where
8787
}
8888
}
8989

90-
impl<T> Named for Chunked<T>
90+
impl<T> Assemblable for Chunked<T>
9191
where
92-
T: Named,
92+
T: Assemblable,
9393
{
9494
fn name(&self) -> &str {
9595
self.object().name()

src/utils/dif_upload.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use crate::api::{
3838
use crate::config::Config;
3939
use crate::constants::{DEFAULT_MAX_DIF_SIZE, DEFAULT_MAX_WAIT};
4040
use crate::utils::chunks::{
41-
upload_chunks, BatchedSliceExt, Chunk, Chunked, ItemSize, MissingObjectsInfo, Named,
41+
upload_chunks, Assemblable, BatchedSliceExt, Chunk, Chunked, ItemSize, MissingObjectsInfo,
4242
ASSEMBLE_POLL_INTERVAL,
4343
};
4444
use crate::utils::dif::ObjectDifFeatures;
@@ -304,7 +304,7 @@ impl Display for DifMatch<'_> {
304304
}
305305
}
306306

307-
impl Named for DifMatch<'_> {
307+
impl Assemblable for DifMatch<'_> {
308308
/// A DIF's name is its file name.
309309
fn name(&self) -> &str {
310310
self.file_name()
@@ -1404,7 +1404,7 @@ fn poll_assemble<T>(
14041404
options: &DifUpload,
14051405
) -> Result<(Vec<DebugInfoFile>, bool)>
14061406
where
1407-
T: Display + Named,
1407+
T: Display + Assemblable,
14081408
Chunked<T>: IntoAssembleRequest,
14091409
{
14101410
let progress_style = ProgressStyle::default_bar().template(

0 commit comments

Comments
 (0)