Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap: clippy fixes #80533

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ impl Rustflags {
fn arg(&mut self, arg: &str) -> &mut Self {
assert_eq!(arg.split(' ').count(), 1);
if !self.0.is_empty() {
self.0.push_str(" ");
self.0.push(' ');
}
self.0.push_str(arg);
self
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ impl GitInfo {
if let Some(ref inner) = self.inner {
version.push_str(" (");
version.push_str(&inner.short_sha);
version.push_str(" ");
version.push(' ');
version.push_str(&inner.commit_date);
version.push_str(")");
version.push(')');
}
version
}
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl Merge for TomlConfig {
*x = Some(new);
}
}
};
}
do_merge(&mut self.build, build);
do_merge(&mut self.install, install);
do_merge(&mut self.llvm, llvm);
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1326,17 +1326,17 @@ impl Step for Extended {
license += &builder.read(&builder.src.join("COPYRIGHT"));
license += &builder.read(&builder.src.join("LICENSE-APACHE"));
license += &builder.read(&builder.src.join("LICENSE-MIT"));
license.push_str("\n");
license.push_str("\n");
license.push('\n');
license.push('\n');

let rtf = r"{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Arial;}}\nowwrap\fs18";
let mut rtf = rtf.to_string();
rtf.push_str("\n");
rtf.push('\n');
for line in license.lines() {
rtf.push_str(line);
rtf.push_str("\\line ");
}
rtf.push_str("}");
rtf.push('}');

fn filter(contents: &str, marker: &str) -> String {
let start = format!("tool-{}-start", marker);
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ impl Build {
if let Some(ref s) = self.config.description {
version.push_str(" (");
version.push_str(s);
version.push_str(")");
version.push(')');
}
version
}
Expand Down Expand Up @@ -1144,7 +1144,7 @@ impl Build {
&& (dep != "profiler_builtins"
|| target
.map(|t| self.config.profiler_enabled(t))
.unwrap_or(self.config.any_profiler_enabled()))
.unwrap_or_else(|| self.config.any_profiler_enabled()))
&& (dep != "rustc_codegen_llvm" || self.config.llvm_enabled())
{
list.push(*dep);
Expand Down
6 changes: 5 additions & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ pub fn check(build: &mut Build) {
panic!("the iOS target is only supported on macOS");
}

build.config.target_config.entry(*target).or_insert(Target::from_triple(&target.triple));
build
.config
.target_config
.entry(*target)
.or_insert_with(|| Target::from_triple(&target.triple));

if target.contains("-none-") || target.contains("nvptx") {
if build.no_std(*target) == Some(false) {
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn setup(src_path: &Path, profile: Profile) {
std::process::exit(1);
}

let path = cfg_file.unwrap_or("config.toml".into());
let path = cfg_file.unwrap_or_else(|| "config.toml".into());
let settings = format!(
"# Includes one of the default files in src/bootstrap/defaults\n\
profile = \"{}\"\n\
Expand Down Expand Up @@ -156,7 +156,7 @@ pub fn interactive_path() -> io::Result<Profile> {
io::stdout().flush()?;
let mut input = String::new();
io::stdin().read_line(&mut input)?;
if input == "" {
if input.is_empty() {
eprintln!("EOF on stdin, when expecting answer to question. Giving up.");
std::process::exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
// flag is respected, so providing an empty --test-args conflicts with
// any following it.
match p.strip_prefix(suite_path).ok().and_then(|p| p.to_str()) {
Some(s) if s != "" => Some(s),
Some(s) if !s.is_empty() => Some(s),
_ => None,
}
})
Expand Down