RS.CLIPPY.INEFFECTIVE_OPEN_OPTIONS

Usage of both `write(true)` and `append(true)` on same `OpenOptions`

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: ineffective_open_options. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks if both .write(true) and .append(true) methods are called on a same OpenOptions.

Why is this bad?

.append(true) already enables write(true), making this one superfluous.

Example

let _ = OpenOptions::new()
           .write(true)
           .append(true)
           .create(true)
           .open("file.json");

Use instead:

let _ = OpenOptions::new()
           .append(true)
           .create(true)
           .open("file.json");