Skip to content

Commit 73746c0

Browse files
authored
Merge pull request cargo-public-api#791 from cargo-public-api/edition-2024
Port more stuff to Edition 2024
2 parents 40a8032 + 6908c05 commit 73746c0

File tree

16 files changed

+34
-27
lines changed

16 files changed

+34
-27
lines changed

cargo-public-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2021"
2+
edition = "2024"
33
name = "cargo-public-api"
44
version = "0.47.1"
55
default-run = "cargo-public-api"

cargo-public-api/src/api_source.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! Contains various ways of obtaining the public API for crates.
22
3-
use anyhow::{anyhow, Context, Result};
3+
use anyhow::{Context, Result, anyhow};
44
use rustdoc_json::BuildError;
55
use std::path::{Path, PathBuf};
66

7-
use public_api::{PublicApi, MINIMUM_NIGHTLY_RUST_VERSION};
7+
use public_api::{MINIMUM_NIGHTLY_RUST_VERSION, PublicApi};
88

9-
use crate::{git_utils, Args, ArgsAndToolchain, Subcommand};
9+
use crate::{Args, ArgsAndToolchain, Subcommand, git_utils};
1010

1111
/// Represents some place from which a public API can be obtained.
1212
/// Examples: a published crate, a git commit, an existing file.

cargo-public-api/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use public_api::{diff::ChangedPublicItem, PublicItem};
1+
use public_api::{PublicItem, diff::ChangedPublicItem};
22

33
#[derive(Debug, thiserror::Error)]
44
pub enum Error {

cargo-public-api/src/git_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
process::Command,
66
};
77

8-
use anyhow::{anyhow, Context, Result};
8+
use anyhow::{Context, Result, anyhow};
99

1010
/// Synchronously do a `git checkout` of `commit`.
1111
pub fn git_checkout(git_root: &Path, commit: &str, quiet: bool, force: bool) -> Result<()> {

cargo-public-api/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::ffi::OsString;
55
use std::io::{stderr, stdout};
66
use std::path::{Path, PathBuf};
77

8-
use anyhow::{anyhow, bail, Result};
8+
use anyhow::{Result, anyhow, bail};
99
use api_source::{ApiSource, Commit, CurrentDir, PublishedCrate, RustdocJson};
1010
use arg_types::{Color, DenyMethod, Omit};
1111
use git_utils::current_branch_or_commit;
@@ -572,7 +572,9 @@ fn subcommand_name(bin: OsString) -> Option<OsString> {
572572
fn resolve_toolchain(args: Args) -> ArgsAndToolchain {
573573
let toolchain = if toolchain::is_probably_stable() {
574574
if let Some(toolchain) = toolchain::from_rustup() {
575-
eprintln!("Warning: using the `{toolchain}` toolchain for gathering the public api is not possible, switching to `nightly`");
575+
eprintln!(
576+
"Warning: using the `{toolchain}` toolchain for gathering the public api is not possible, switching to `nightly`"
577+
);
576578
}
577579
Some("nightly".to_owned())
578580
} else {

cargo-public-api/src/plain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::io::{Result, Write};
22

33
use nu_ansi_term::{AnsiString, AnsiStrings, Color, Style};
4-
use public_api::{diff::PublicApiDiff, tokens::Token, PublicItem};
4+
use public_api::{PublicItem, diff::PublicApiDiff, tokens::Token};
55

66
use crate::Args;
77

cargo-public-api/src/published_crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! project.
44
55
use crate::{Args, ArgsAndToolchain, LATEST_VERSION_ARG};
6-
use anyhow::{anyhow, Context, Result};
6+
use anyhow::{Context, Result, anyhow};
77
use crates_index::{Crate, Version};
88
use std::path::PathBuf;
99

cargo-public-api/tests/cargo-public-api-bin-tests.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use std::{
1515
path::{Path, PathBuf},
1616
};
1717

18-
use assert_cmd::assert::Assert;
1918
use assert_cmd::Command;
19+
use assert_cmd::assert::Assert;
2020
use chrono::{Days, NaiveDate};
2121
use predicates::prelude::PredicateBooleanExt;
2222
use predicates::str::contains;
@@ -1300,7 +1300,10 @@ impl TestRepo {
13001300
impl Drop for TestRepo {
13011301
fn drop(&mut self) {
13021302
if env::var_os("CARGO_PUBLIC_API_PRESERVE_TEST_REPO").is_some() {
1303-
println!("DEBUG: NOT removing test repo at {:?}. If the test fails, you can `cd` into it and debug the failure", self.path());
1303+
println!(
1304+
"DEBUG: NOT removing test repo at {:?}. If the test fails, you can `cd` into it and debug the failure",
1305+
self.path()
1306+
);
13041307
} else {
13051308
remove_dir_all::remove_dir_all(self.path()).unwrap();
13061309
}

public-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2021"
2+
edition = "2024"
33
name = "public-api"
44
version = "0.47.1"
55
description = "List and diff the public API of Rust library crates. Relies on rustdoc JSON output from the nightly toolchain."

public-api/src/diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
//! additional helpers for that.
55
66
use crate::{
7-
public_item::{PublicItem, PublicItemPath},
87
PublicApi,
8+
public_item::{PublicItem, PublicItemPath},
99
};
1010
use hashbag::HashBag;
1111
use std::collections::HashMap;

0 commit comments

Comments
 (0)