Skip to content

Commit 514f77b

Browse files
authored
Merge pull request #1131 from JDemler/master
No warning when file is opened with read truncate and write
2 parents 1a38503 + d0fb8d7 commit 514f77b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/open_options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn check_open_options(cx: &LateContext, options: &[(OpenOption, Argument)], span
178178
}
179179
}
180180

181-
if read && truncate && read_arg && truncate_arg {
181+
if read && truncate && read_arg && truncate_arg && !(write && write_arg) {
182182
span_lint(cx, NONSENSICAL_OPEN_OPTIONS, span, "file opened with \"truncate\" and \"read\"");
183183
}
184184
if append && truncate && append_arg && truncate_arg {

0 commit comments

Comments
 (0)