Skip to content

Commit

Permalink
Make Clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jan 11, 2024
1 parent 8661abd commit e845a4a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion cargo-dylint/tests/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ fn fix() {
fn append_workspace_metadata(path: &Path) -> Result<()> {
let manifest = path.join("Cargo.toml");
let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(&manifest)
.with_context(|| format!("Could not open `{}`", manifest.to_string_lossy()))?;
Expand Down
7 changes: 0 additions & 7 deletions cargo-dylint/tests/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ fn invalid_pattern() {
.unwrap();

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(tempdir.path().join("Cargo.toml"))
.unwrap();
Expand Down Expand Up @@ -73,7 +72,6 @@ fn list() {
.unwrap();

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(tempdir.path().join("Cargo.toml"))
.unwrap();
Expand Down Expand Up @@ -112,7 +110,6 @@ fn metadata_change() {
isolate(tempdir.path()).unwrap();

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(tempdir.path().join("Cargo.toml"))
.unwrap();
Expand Down Expand Up @@ -174,7 +171,6 @@ fn nonexistent_git_library() {
.unwrap();

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(tempdir.path().join("Cargo.toml"))
.unwrap();
Expand Down Expand Up @@ -229,7 +225,6 @@ fn nonexistent_path_library() {
isolate(tempdir.path()).unwrap();

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(tempdir.path().join("Cargo.toml"))
.unwrap();
Expand Down Expand Up @@ -285,7 +280,6 @@ fn rustflags_change() {
isolate(tempdir.path()).unwrap();

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(tempdir.path().join("Cargo.toml"))
.unwrap();
Expand Down Expand Up @@ -330,7 +324,6 @@ fn unknown_keys() {
.unwrap();

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(tempdir.path().join("Cargo.toml"))
.unwrap();
Expand Down
4 changes: 1 addition & 3 deletions examples/experimental/missing_doc_comment_openai/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDocCommentOpenai {
}

let doc_comment = std::env::var(OPENAI_API_KEY).ok().and_then(|api_key| {
let Some(snippet) = snippet_opt(cx, item.span) else {
return None;
};
let snippet = snippet_opt(cx, item.span)?;

let request = self.request_from_snippet(&snippet);

Expand Down
2 changes: 0 additions & 2 deletions internal/src/packaging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ pub fn new_template(to: &Path) -> Result<()> {
pub fn isolate(path: &Path) -> Result<()> {
let manifest = path.join("Cargo.toml");
let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(&manifest)
.with_context(|| format!("Could not open `{}`", manifest.to_string_lossy()))?;
Expand All @@ -63,7 +62,6 @@ pub fn use_local_packages(path: &Path) -> Result<()> {
let manifest = path.join("Cargo.toml");

let mut file = OpenOptions::new()
.write(true)
.append(true)
.open(&manifest)
.with_context(|| format!("Could not open `{}`", manifest.to_string_lossy()))?;
Expand Down

0 comments on commit e845a4a

Please sign in to comment.