Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: use Path::display() when printing a path #1150

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions prost-build/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ impl Config {

if let Some(ref include_file) = self.include_file {
let path = target.join(include_file);
trace!("Writing include file: {:?}", path);
trace!("Writing include file: {}", path.display());
let mut buffer = Vec::new();
self.write_line(&mut buffer, 0, "// This file is @generated by prost-build.")?;
self.write_includes(
Expand Down Expand Up @@ -943,7 +943,7 @@ impl Config {
)),
Err(err) => return Err(Error::new(
err.kind(),
format!("failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: {:?}): {}", &self.protoc_executable, err),
format!("failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: {}): {}", &self.protoc_executable.display(), err),
)),
Ok(output) => output,
};
Expand All @@ -960,8 +960,9 @@ impl Config {
Error::new(
e.kind(),
format!(
"unable to open file_descriptor_set_path: {:?}, OS: {}",
&file_descriptor_set_path, e
"unable to open file_descriptor_set_path: {}, OS: {}",
file_descriptor_set_path.display(),
e
),
)
})?;
Expand Down Expand Up @@ -1140,10 +1141,10 @@ fn write_file_if_changed(path: &Path, content: &[u8]) -> std::io::Result<()> {
.map(|previous_content| previous_content == content)
.unwrap_or(false)
{
trace!("unchanged: {:?}", path);
trace!("unchanged: {}", path.display());
Ok(())
} else {
trace!("writing: {:?}", path);
trace!("writing: {}", path.display());
fs::write(path, content)
}
}
Expand Down Expand Up @@ -1236,14 +1237,14 @@ pub fn protoc_include_from_env() -> Option<PathBuf> {

if !protoc_include.exists() {
panic!(
"PROTOC_INCLUDE environment variable points to non-existent directory ({:?})",
protoc_include
"PROTOC_INCLUDE environment variable points to non-existent directory ({})",
protoc_include.display()
);
}
if !protoc_include.is_dir() {
panic!(
"PROTOC_INCLUDE environment variable points to a non-directory file ({:?})",
protoc_include
"PROTOC_INCLUDE environment variable points to a non-directory file ({})",
protoc_include.display()
);
}

Expand Down