Skip to content

Commit 46327d7

Browse files
ehussdjc
authored andcommitted
Fix dead_code and unused_imports warnings
1 parent bbb9276 commit 46327d7

File tree

9 files changed

+8
-17
lines changed

9 files changed

+8
-17
lines changed

src/cli/self_update.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ use crate::{
7979
};
8080

8181
use os::*;
82-
pub(crate) use os::{delete_rustup_and_cargo_home, run_update, self_replace};
82+
pub(crate) use os::{run_update, self_replace};
8383
#[cfg(windows)]
8484
pub use windows::complete_windows_uninstall;
8585

src/currentprocess.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use std::boxed::Box;
21
use std::cell::RefCell;
3-
use std::default::Default;
42
use std::env;
53
use std::ffi::OsString;
64
use std::fmt::Debug;

src/currentprocess/terminalsource.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub struct ColorableTerminal {
5959
enum TerminalInner {
6060
StandardStream(StandardStream, ColorSpec),
6161
#[cfg(feature = "test")]
62+
#[allow(dead_code)] // ColorChoice only read in test code
6263
TestWriter(TestWriter, ColorChoice),
6364
}
6465

src/diskio/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ pub(crate) enum CompletedIo {
206206
/// A submitted Item has completed
207207
Item(Item),
208208
/// An IncrementalFile has completed a single chunk
209+
#[allow(dead_code)] // chunk size only used in test code
209210
Chunk(usize),
210211
}
211212

src/dist/component/package.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl Package for DirectoryPackage {
137137
}
138138

139139
#[derive(Debug)]
140+
#[allow(dead_code)] // temp::Dir is held for drop.
140141
pub(crate) struct TarPackage<'a>(DirectoryPackage, temp::Dir<'a>);
141142

142143
impl<'a> TarPackage<'a> {

src/dist/dist.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use crate::{
2121
manifestation::{Changes, Manifestation, UpdateStatus},
2222
notifications::*,
2323
prefix::InstallPrefix,
24-
temp,
2524
},
2625
errors::RustupError,
2726
process,
@@ -622,9 +621,6 @@ impl TryFrom<&ToolchainName> for ToolchainDesc {
622621
}
623622
}
624623

625-
#[derive(Debug)]
626-
pub(crate) struct Manifest<'a>(temp::File<'a>, String);
627-
628624
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)]
629625
pub enum Profile {
630626
Minimal,

src/install.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ impl<'a> InstallMethod<'a> {
7171
_ => (nh)(RootNotification::UpdatingToolchain(&self.dest_basename())),
7272
}
7373

74-
(self.cfg().notify_handler)(RootNotification::ToolchainDirectory(
75-
&self.dest_path(),
76-
&self.dest_basename(),
77-
));
74+
(self.cfg().notify_handler)(RootNotification::ToolchainDirectory(&self.dest_path()));
7875
let updated = self.run(&self.dest_path(), &|n| {
7976
(self.cfg().notify_handler)(n.into())
8077
})?;

src/notifications.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(crate) enum Notification<'a> {
1818
SetProfile(&'a str),
1919
SetSelfUpdate(&'a str),
2020
LookingForToolchain(&'a ToolchainDesc),
21-
ToolchainDirectory(&'a Path, &'a str),
21+
ToolchainDirectory(&'a Path),
2222
UpdatingToolchain(&'a str),
2323
InstallingToolchain(&'a str),
2424
InstalledToolchain(&'a str),
@@ -62,7 +62,7 @@ impl<'a> Notification<'a> {
6262
Install(n) => n.level(),
6363
Utils(n) => n.level(),
6464
Temp(n) => n.level(),
65-
ToolchainDirectory(_, _)
65+
ToolchainDirectory(_)
6666
| LookingForToolchain(_)
6767
| InstallingToolchain(_)
6868
| UpdatingToolchain(_)
@@ -103,7 +103,7 @@ impl<'a> Display for Notification<'a> {
103103
SetProfile(name) => write!(f, "profile set to '{name}'"),
104104
SetSelfUpdate(mode) => write!(f, "auto-self-update mode set to '{mode}'"),
105105
LookingForToolchain(name) => write!(f, "looking for installed toolchain '{name}'"),
106-
ToolchainDirectory(path, _) => write!(f, "toolchain directory: '{}'", path.display()),
106+
ToolchainDirectory(path) => write!(f, "toolchain directory: '{}'", path.display()),
107107
UpdatingToolchain(name) => write!(f, "updating existing install for '{name}'"),
108108
InstallingToolchain(name) => write!(f, "installing toolchain '{name}'"),
109109
InstalledToolchain(name) => write!(f, "toolchain '{name}' installed"),

src/utils/raw.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ use std::io::Write;
77
use std::path::Path;
88
use std::str;
99

10-
#[cfg(not(windows))]
11-
use libc;
12-
1310
#[cfg(not(windows))]
1411
use crate::{currentprocess::varsource::VarSource, process};
1512

0 commit comments

Comments
 (0)