Skip to content

Commit 5a6ca6b

Browse files
committed
docs for valid use
1 parent 6c2f56f commit 5a6ca6b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clippy_lints/src/paths_from_format.rs

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ fn push_comps(string: &mut String, path: &str) {
124124
}
125125
}
126126

127+
// In essence, this checks if the format!() used is made for concatenation of the filenames / folder names itself.
128+
// This returns true when it is something like `PathBuf::from(format!("/x/folder{}/textfile.txt", folder_number))
127129
fn is_valid_use_case(string: &str, string2: &str) -> bool {
128130
!(string.is_empty() || string.ends_with('/') || string.ends_with('\\'))
129131
|| !(string2.is_empty() || string2.starts_with('/') || string2.starts_with('\\'))

0 commit comments

Comments
 (0)