Skip to content

Commit b2d0ade

Browse files
committed
tests/builders/publish: Use self.tarball() to simplify files() fn
1 parent 7d69275 commit b2d0ade

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/tests/builders/publish.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,14 @@ impl PublishBuilder {
4848
}
4949

5050
/// Set the files in the crate's tarball.
51-
pub fn files(mut self, files: &[(&str, &[u8])]) -> Self {
51+
pub fn files(self, files: &[(&str, &[u8])]) -> Self {
5252
let mut builder = TarballBuilder::new(&self.krate_name, &self.version.to_string());
5353

5454
for (name, data) in files {
5555
builder = builder.add_file(name, data);
5656
}
5757

58-
self.tarball = builder.build();
59-
self
58+
self.tarball(builder.build())
6059
}
6160

6261
/// Set the tarball directly to the given Vec of bytes

0 commit comments

Comments
 (0)