Skip to content

Commit

Permalink
Use a simple literal expression for path values instead of conversion…
Browse files Browse the repository at this point in the history
… expression between String and PathBuf
  • Loading branch information
ivan23kor committed Apr 25, 2024
1 parent 8eec79d commit 278ccdc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions rstest_macros/src/parse/rstest/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl<'a> ValueListFromFiles<'a> {
let path_str = abs_path.to_string_lossy();
values.push((
parse_quote! {
<::std::path::PathBuf as std::str::FromStr>::from_str(#path_str).unwrap()
#path_str
},
render_file_description(&relative_path),
));
Expand Down Expand Up @@ -640,12 +640,7 @@ mod should {
.iter()
.map(|&p| RelativePath::from_path(p).unwrap())
.map(|r| r.to_logical_path(bdir))
.map(|p| {
format!(
r#"<::std::path::PathBuf as std::str::FromStr>::from_str("{}").unwrap()"#,
p.as_os_str().to_str().unwrap()
)
})
.map(|p| format!("{p:?}"))
.collect::<Vec<_>>(),
);
v_list
Expand Down

0 comments on commit 278ccdc

Please sign in to comment.