File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,16 @@ lazy_static! {
9
9
// The bytes of an empty tarball is not an empty vector of bytes because of tarball headers.
10
10
// Unless files are added to a PublishBuilder, the `.crate` tarball that gets uploaded
11
11
// will be empty, so precompute the empty tarball bytes to use as a default.
12
- static ref EMPTY_TARBALL_BYTES : Vec <u8 > = {
13
- let mut empty_tarball = vec![ ] ;
14
- {
15
- let mut ar =
16
- tar:: Builder :: new( GzEncoder :: new( & mut empty_tarball, Compression :: default ( ) ) ) ;
17
- assert_ok!( ar. finish( ) ) ;
18
- }
19
- empty_tarball
20
- } ;
12
+ static ref EMPTY_TARBALL_BYTES : Vec <u8 > = generate_empty_tarball( ) ;
13
+ }
14
+
15
+ fn generate_empty_tarball ( ) -> Vec < u8 > {
16
+ let mut empty_tarball = vec ! [ ] ;
17
+ {
18
+ let mut ar = tar:: Builder :: new ( GzEncoder :: new ( & mut empty_tarball, Compression :: default ( ) ) ) ;
19
+ assert_ok ! ( ar. finish( ) ) ;
20
+ }
21
+ empty_tarball
21
22
}
22
23
23
24
/// A builder for constructing a crate for the purposes of testing publishing. If you only need
You can’t perform that action at this time.
0 commit comments