@@ -321,8 +321,9 @@ pub fn set_host_rpath(cmd: &mut Command) {
321
321
/// Read the contents of a file that cannot simply be read by
322
322
/// read_to_string, due to invalid utf8 data, then assert that it contains `expected`.
323
323
#[ track_caller]
324
- pub fn invalid_utf8_contains < P : AsRef < Path > > ( path : P , expected : & str ) {
324
+ pub fn invalid_utf8_contains < P : AsRef < Path > , S : AsRef < str > > ( path : P , expected : S ) {
325
325
let buffer = fs_wrapper:: read ( path. as_ref ( ) ) ;
326
+ let expected = expected. as_ref ( ) ;
326
327
if !String :: from_utf8_lossy ( & buffer) . contains ( expected) {
327
328
eprintln ! ( "=== FILE CONTENTS (LOSSY) ===" ) ;
328
329
eprintln ! ( "{}" , String :: from_utf8_lossy( & buffer) ) ;
@@ -335,8 +336,9 @@ pub fn invalid_utf8_contains<P: AsRef<Path>>(path: P, expected: &str) {
335
336
/// Read the contents of a file that cannot simply be read by
336
337
/// read_to_string, due to invalid utf8 data, then assert that it does not contain `expected`.
337
338
#[ track_caller]
338
- pub fn invalid_utf8_not_contains < P : AsRef < Path > > ( path : P , expected : & str ) {
339
+ pub fn invalid_utf8_not_contains < P : AsRef < Path > , S : AsRef < str > > ( path : P , expected : S ) {
339
340
let buffer = fs_wrapper:: read ( path. as_ref ( ) ) ;
341
+ let expected = expected. as_ref ( ) ;
340
342
if String :: from_utf8_lossy ( & buffer) . contains ( expected) {
341
343
eprintln ! ( "=== FILE CONTENTS (LOSSY) ===" ) ;
342
344
eprintln ! ( "{}" , String :: from_utf8_lossy( & buffer) ) ;
0 commit comments