@@ -178,13 +178,13 @@ impl FixtureWithProjectMeta {
178
178
179
179
if let Some ( meta) = fixture. strip_prefix ( "//- toolchain:" ) {
180
180
let ( meta, remain) = meta. split_once ( '\n' ) . unwrap ( ) ;
181
- toolchain = Some ( meta. trim ( ) . to_string ( ) ) ;
181
+ toolchain = Some ( meta. trim ( ) . to_owned ( ) ) ;
182
182
fixture = remain;
183
183
}
184
184
185
185
if let Some ( meta) = fixture. strip_prefix ( "//- proc_macros:" ) {
186
186
let ( meta, remain) = meta. split_once ( '\n' ) . unwrap ( ) ;
187
- proc_macro_names = meta. split ( ',' ) . map ( |it| it. trim ( ) . to_string ( ) ) . collect ( ) ;
187
+ proc_macro_names = meta. split ( ',' ) . map ( |it| it. trim ( ) . to_owned ( ) ) . collect ( ) ;
188
188
fixture = remain;
189
189
}
190
190
@@ -234,7 +234,7 @@ impl FixtureWithProjectMeta {
234
234
let meta = meta[ "//-" . len ( ) ..] . trim ( ) ;
235
235
let mut components = meta. split_ascii_whitespace ( ) ;
236
236
237
- let path = components. next ( ) . expect ( "fixture meta must start with a path" ) . to_string ( ) ;
237
+ let path = components. next ( ) . expect ( "fixture meta must start with a path" ) . to_owned ( ) ;
238
238
assert ! ( path. starts_with( '/' ) , "fixture path does not start with `/`: {path:?}" ) ;
239
239
240
240
let mut krate = None ;
@@ -246,7 +246,7 @@ impl FixtureWithProjectMeta {
246
246
let mut introduce_new_source_root = None ;
247
247
let mut library = false ;
248
248
let mut target_data_layout = Some (
249
- "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" . to_string ( ) ,
249
+ "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" . to_owned ( ) ,
250
250
) ;
251
251
for component in components {
252
252
if component == "library" {
@@ -257,22 +257,22 @@ impl FixtureWithProjectMeta {
257
257
let ( key, value) =
258
258
component. split_once ( ':' ) . unwrap_or_else ( || panic ! ( "invalid meta line: {meta:?}" ) ) ;
259
259
match key {
260
- "crate" => krate = Some ( value. to_string ( ) ) ,
261
- "deps" => deps = value. split ( ',' ) . map ( |it| it. to_string ( ) ) . collect ( ) ,
260
+ "crate" => krate = Some ( value. to_owned ( ) ) ,
261
+ "deps" => deps = value. split ( ',' ) . map ( |it| it. to_owned ( ) ) . collect ( ) ,
262
262
"extern-prelude" => {
263
263
if value. is_empty ( ) {
264
264
extern_prelude = Some ( Vec :: new ( ) ) ;
265
265
} else {
266
266
extern_prelude =
267
- Some ( value. split ( ',' ) . map ( |it| it. to_string ( ) ) . collect :: < Vec < _ > > ( ) ) ;
267
+ Some ( value. split ( ',' ) . map ( |it| it. to_owned ( ) ) . collect :: < Vec < _ > > ( ) ) ;
268
268
}
269
269
}
270
- "edition" => edition = Some ( value. to_string ( ) ) ,
270
+ "edition" => edition = Some ( value. to_owned ( ) ) ,
271
271
"cfg" => {
272
272
for entry in value. split ( ',' ) {
273
273
match entry. split_once ( '=' ) {
274
- Some ( ( k, v) ) => cfgs. push ( ( k. to_string ( ) , Some ( v. to_string ( ) ) ) ) ,
275
- None => cfgs. push ( ( entry. to_string ( ) , None ) ) ,
274
+ Some ( ( k, v) ) => cfgs. push ( ( k. to_owned ( ) , Some ( v. to_owned ( ) ) ) ) ,
275
+ None => cfgs. push ( ( entry. to_owned ( ) , None ) ) ,
276
276
}
277
277
}
278
278
}
@@ -283,8 +283,8 @@ impl FixtureWithProjectMeta {
283
283
}
284
284
}
285
285
}
286
- "new_source_root" => introduce_new_source_root = Some ( value. to_string ( ) ) ,
287
- "target_data_layout" => target_data_layout = Some ( value. to_string ( ) ) ,
286
+ "new_source_root" => introduce_new_source_root = Some ( value. to_owned ( ) ) ,
287
+ "target_data_layout" => target_data_layout = Some ( value. to_owned ( ) ) ,
288
288
_ => panic ! ( "bad component: {component:?}" ) ,
289
289
}
290
290
}
@@ -381,7 +381,7 @@ impl MiniCore {
381
381
let ( flag, deps) = line. split_once ( ':' ) . unwrap ( ) ;
382
382
let flag = flag. trim ( ) ;
383
383
384
- self . valid_flags . push ( flag. to_string ( ) ) ;
384
+ self . valid_flags . push ( flag. to_owned ( ) ) ;
385
385
implications. extend (
386
386
iter:: repeat ( flag)
387
387
. zip ( deps. split ( ", " ) . map ( str:: trim) . filter ( |dep| !dep. is_empty ( ) ) ) ,
@@ -401,7 +401,7 @@ impl MiniCore {
401
401
let mut changed = false ;
402
402
for & ( u, v) in & implications {
403
403
if self . has_flag ( u) && !self . has_flag ( v) {
404
- self . activated_flags . push ( v. to_string ( ) ) ;
404
+ self . activated_flags . push ( v. to_owned ( ) ) ;
405
405
changed = true ;
406
406
}
407
407
}
@@ -486,9 +486,9 @@ fn parse_fixture_gets_full_meta() {
486
486
mod m;
487
487
"# ,
488
488
) ;
489
- assert_eq ! ( toolchain, Some ( "nightly" . to_string ( ) ) ) ;
490
- assert_eq ! ( proc_macro_names, vec![ "identity" . to_string ( ) ] ) ;
491
- assert_eq ! ( mini_core. unwrap( ) . activated_flags, vec![ "coerce_unsized" . to_string ( ) ] ) ;
489
+ assert_eq ! ( toolchain, Some ( "nightly" . to_owned ( ) ) ) ;
490
+ assert_eq ! ( proc_macro_names, vec![ "identity" . to_owned ( ) ] ) ;
491
+ assert_eq ! ( mini_core. unwrap( ) . activated_flags, vec![ "coerce_unsized" . to_owned ( ) ] ) ;
492
492
assert_eq ! ( 1 , parsed. len( ) ) ;
493
493
494
494
let meta = & parsed[ 0 ] ;
0 commit comments