File tree 4 files changed +5
-5
lines changed
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ const RUSTC_VERSION: Option<&str> = option_env!("CFG_VERSION");
203
203
204
204
impl CodegenResults {
205
205
pub fn serialize_rlink ( codegen_results : & CodegenResults ) -> Vec < u8 > {
206
- let mut encoder = opaque:: Encoder :: new ( vec ! [ ] ) ;
206
+ let mut encoder = opaque:: Encoder :: new ( ) ;
207
207
encoder. emit_raw_bytes ( RLINK_MAGIC ) . unwrap ( ) ;
208
208
// `emit_raw_bytes` is used to make sure that the version representation does not depend on
209
209
// Encoder's inner representation of `u32`.
Original file line number Diff line number Diff line change @@ -2194,7 +2194,7 @@ pub fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
2194
2194
}
2195
2195
2196
2196
fn encode_metadata_impl ( tcx : TyCtxt < ' _ > ) -> EncodedMetadata {
2197
- let mut encoder = opaque:: Encoder :: new ( vec ! [ ] ) ;
2197
+ let mut encoder = opaque:: Encoder :: new ( ) ;
2198
2198
encoder. emit_raw_bytes ( METADATA_HEADER ) . unwrap ( ) ;
2199
2199
2200
2200
// Will be filled with the root position after encoding everything.
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ pub struct Encoder {
18
18
}
19
19
20
20
impl Encoder {
21
- pub fn new ( data : Vec < u8 > ) -> Encoder {
22
- Encoder { data }
21
+ pub fn new ( ) -> Encoder {
22
+ Encoder { data : vec ! [ ] }
23
23
}
24
24
25
25
pub fn into_inner ( self ) -> Vec < u8 > {
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ struct Struct {
31
31
fn check_round_trip < T : Encodable < Encoder > + for < ' a > Decodable < Decoder < ' a > > + PartialEq + Debug > (
32
32
values : Vec < T > ,
33
33
) {
34
- let mut encoder = Encoder :: new ( Vec :: new ( ) ) ;
34
+ let mut encoder = Encoder :: new ( ) ;
35
35
36
36
for value in & values {
37
37
Encodable :: encode ( value, & mut encoder) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments