@@ -321,8 +321,9 @@ pub fn set_host_rpath(cmd: &mut Command) {
321321/// Read the contents of a file that cannot simply be read by
322322/// read_to_string, due to invalid utf8 data, then assert that it contains `expected`.
323323#[ 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 ) {
325325 let buffer = fs_wrapper:: read ( path. as_ref ( ) ) ;
326+ let expected = expected. as_ref ( ) ;
326327 if !String :: from_utf8_lossy ( & buffer) . contains ( expected) {
327328 eprintln ! ( "=== FILE CONTENTS (LOSSY) ===" ) ;
328329 eprintln ! ( "{}" , String :: from_utf8_lossy( & buffer) ) ;
@@ -335,8 +336,9 @@ pub fn invalid_utf8_contains<P: AsRef<Path>>(path: P, expected: &str) {
335336/// Read the contents of a file that cannot simply be read by
336337/// read_to_string, due to invalid utf8 data, then assert that it does not contain `expected`.
337338#[ 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 ) {
339340 let buffer = fs_wrapper:: read ( path. as_ref ( ) ) ;
341+ let expected = expected. as_ref ( ) ;
340342 if String :: from_utf8_lossy ( & buffer) . contains ( expected) {
341343 eprintln ! ( "=== FILE CONTENTS (LOSSY) ===" ) ;
342344 eprintln ! ( "{}" , String :: from_utf8_lossy( & buffer) ) ;
0 commit comments