Skip to content

Commit d0fb8d7

Browse files
committed
No warning when file is opened with read truncate and write
1 parent 1a38503 commit d0fb8d7

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)