Skip to content

Commit 39526f9

Browse files
committed
style: format sources with the 2024 Style Edition
1 parent e41930d commit 39526f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+306
-204
lines changed

download/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ pub mod reqwest_be {
327327
use std::sync::LazyLock;
328328
use std::time::Duration;
329329

330-
use anyhow::{anyhow, Context, Result};
331-
use reqwest::{header, Client, ClientBuilder, Proxy, Response};
330+
use anyhow::{Context, Result, anyhow};
331+
use reqwest::{Client, ClientBuilder, Proxy, Response, header};
332332
#[cfg(feature = "reqwest-rustls-tls")]
333333
use rustls::crypto::aws_lc_rs;
334334
#[cfg(feature = "reqwest-rustls-tls")]

download/tests/download-curl-resume.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(feature = "curl-backend")]
22

3-
use std::sync::atomic::{AtomicBool, Ordering};
43
use std::sync::Mutex;
4+
use std::sync::atomic::{AtomicBool, Ordering};
55

66
use url::Url;
77

download/tests/download-reqwest-resume.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(any(feature = "reqwest-rustls-tls", feature = "reqwest-native-tls"))]
22

3-
use std::sync::atomic::{AtomicBool, Ordering};
43
use std::sync::Mutex;
4+
use std::sync::atomic::{AtomicBool, Ordering};
55

66
use url::Url;
77

download/tests/read-proxy-env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use std::env::{remove_var, set_var};
44
use std::error::Error;
55
use std::net::TcpListener;
6-
use std::sync::atomic::{AtomicUsize, Ordering};
76
use std::sync::LazyLock;
7+
use std::sync::atomic::{AtomicUsize, Ordering};
88
use std::thread;
99
use std::time::Duration;
1010

download/tests/support/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ use std::fs;
33
use std::io;
44
use std::net::SocketAddr;
55
use std::path::Path;
6-
use std::sync::mpsc::{channel, Sender};
6+
use std::sync::mpsc::{Sender, channel};
77
use std::thread;
88

99
use http_body_util::Full;
10+
use hyper::Request;
1011
use hyper::body::Bytes;
1112
use hyper::server::conn::http1;
1213
use hyper::service::service_fn;
13-
use hyper::Request;
1414
use tempfile::TempDir;
1515

1616
pub fn tmp_dir() -> TempDir {

rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style_edition = "2024"

src/bin/rustup-init.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515

1616
use std::process::ExitCode;
1717

18-
use anyhow::{anyhow, Context, Result};
18+
use anyhow::{Context, Result, anyhow};
1919
use cfg_if::cfg_if;
2020
// Public macros require availability of the internal symbols
2121
use rs_tracing::{
2222
close_trace_file, close_trace_file_internal, open_trace_file, trace_to_file_internal,
2323
};
24-
use tracing_subscriber::{reload::Handle, EnvFilter, Registry};
24+
use tracing_subscriber::{EnvFilter, Registry, reload::Handle};
2525

2626
use rustup::cli::common;
2727
use rustup::cli::proxy_mode;
@@ -145,7 +145,7 @@ fn do_recursion_guard(process: &Process) -> Result<()> {
145145
#[cfg(windows)]
146146
pub fn pre_rustup_main_init() {
147147
use windows_sys::Win32::System::LibraryLoader::{
148-
SetDefaultDllDirectories, LOAD_LIBRARY_SEARCH_SYSTEM32,
148+
LOAD_LIBRARY_SEARCH_SYSTEM32, SetDefaultDllDirectories,
149149
};
150150
// Default to loading delay loaded DLLs from the system directory.
151151
// For DLLs loaded at load time, this relies on the `delayload` linker flag.

src/cli/common.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ use std::path::{Path, PathBuf};
1010
use std::sync::{Arc, LazyLock, Mutex};
1111
use std::{cmp, env};
1212

13-
use anyhow::{anyhow, Context, Result};
13+
use anyhow::{Context, Result, anyhow};
1414
use git_testament::{git_testament, render_testament};
1515
use tracing::{debug, error, info, trace, warn};
16-
use tracing_subscriber::{reload::Handle, EnvFilter, Registry};
16+
use tracing_subscriber::{EnvFilter, Registry, reload::Handle};
1717

1818
use super::self_update;
1919
use crate::{
2020
cli::download_tracker::DownloadTracker,
2121
config::Cfg,
2222
dist::{
23-
manifest::ComponentStatus, notifications as dist_notifications, TargetTriple, ToolchainDesc,
23+
TargetTriple, ToolchainDesc, manifest::ComponentStatus, notifications as dist_notifications,
2424
},
2525
errors::RustupError,
2626
install::UpdateStatus,
2727
notifications::Notification,
28-
process::{terminalsource, Process},
28+
process::{Process, terminalsource},
2929
toolchain::{DistributableToolchain, LocalToolchainName, Toolchain, ToolchainName},
3030
utils::{self, notifications as util_notifications, notify::NotificationLevel},
3131
};
@@ -654,7 +654,9 @@ pub(crate) fn warn_if_host_is_emulated(process: &Process) {
654654
"Rustup is not running natively. It's running under emulation of {}.",
655655
TargetTriple::from_host_or_build(process)
656656
);
657-
warn!("For best compatibility and performance you should reinstall rustup for your native CPU.");
657+
warn!(
658+
"For best compatibility and performance you should reinstall rustup for your native CPU."
659+
);
658660
}
659661
}
660662

src/cli/download_tracker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use std::time::{Duration, Instant};
55

66
use crate::dist::Notification as In;
77
use crate::notifications::Notification;
8-
use crate::process::{terminalsource, Process};
9-
use crate::utils::units::{Size, Unit, UnitMode};
8+
use crate::process::{Process, terminalsource};
109
use crate::utils::Notification as Un;
10+
use crate::utils::units::{Size, Unit, UnitMode};
1111

1212
/// Keep track of this many past download amounts
1313
const DOWNLOAD_TRACK_COUNT: usize = 5;

src/cli/help.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,7 @@ pub(crate) static COMPLETIONS_HELP: &str = r"Discussion:
278278
279279
$ rustup completions zsh cargo > ~/.zfunc/_cargo";
280280

281-
pub(crate) static OFFICIAL_TOOLCHAIN_ARG_HELP: &str =
282-
"Toolchain name, such as 'stable', 'nightly', \
281+
pub(crate) static OFFICIAL_TOOLCHAIN_ARG_HELP: &str = "Toolchain name, such as 'stable', 'nightly', \
283282
or '1.8.0'. For more information see `rustup \
284283
help toolchain`";
285284
pub(crate) static RESOLVABLE_LOCAL_TOOLCHAIN_ARG_HELP: &str = "Toolchain name, such as 'stable', 'nightly', \

0 commit comments

Comments
 (0)