Skip to content

Commit ad51015

Browse files
committed
Fix by cargo-clippy
1 parent 52de2ef commit ad51015

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

openblas-build/src/check.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl LinkFlags {
3838
pub fn parse(line: &str) -> Result<Self, Error> {
3939
let mut search_paths = HashSet::new();
4040
let mut libs = HashSet::new();
41-
for entry in line.split(" ") {
41+
for entry in line.split(' ') {
4242
if entry.starts_with("-L") {
4343
let path = PathBuf::from(entry.trim_start_matches("-L"));
4444
if !path.exists() {
@@ -79,10 +79,10 @@ impl MakeConf {
7979
let buf = io::BufReader::new(f);
8080
for line in buf.lines() {
8181
let line = line.expect("Makefile.conf should not include non-UTF8 string");
82-
if line.len() == 0 {
82+
if line.is_empty() {
8383
continue;
8484
}
85-
let entry: Vec<_> = line.split("=").collect();
85+
let entry: Vec<_> = line.split('=').collect();
8686
if entry.len() != 2 {
8787
continue;
8888
}
@@ -133,7 +133,7 @@ impl LibInspect {
133133
.lines()
134134
.flat_map(|line| {
135135
let line = line.expect("nm output should not include non-UTF8 output");
136-
let entry: Vec<_> = line.trim().split(" ").collect();
136+
let entry: Vec<_> = line.trim().split(' ').collect();
137137
if entry.len() == 3 && entry[1] == "T" {
138138
Some(entry[2].into())
139139
} else {
@@ -173,7 +173,7 @@ impl LibInspect {
173173
return true;
174174
}
175175
}
176-
return false;
176+
false
177177
}
178178

179179
pub fn has_lapack(&self) -> bool {
@@ -182,7 +182,7 @@ impl LibInspect {
182182
return true;
183183
}
184184
}
185-
return false;
185+
false
186186
}
187187

188188
pub fn has_lapacke(&self) -> bool {
@@ -191,18 +191,18 @@ impl LibInspect {
191191
return true;
192192
}
193193
}
194-
return false;
194+
false
195195
}
196196

197197
pub fn has_lib(&self, name: &str) -> bool {
198198
for lib in &self.libs {
199-
if let Some(stem) = lib.split(".").next() {
199+
if let Some(stem) = lib.split('.').next() {
200200
if stem == format!("lib{}", name) {
201201
return true;
202202
}
203203
};
204204
}
205-
return false;
205+
false
206206
}
207207
}
208208

openblas-src/build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ fn build() {
127127
// It makes users not to build OpenBLAS in every `cargo build`.
128128
let mut hasher = DefaultHasher::new();
129129
cfg.hash(&mut hasher);
130-
let output = dirs::data_dir()
130+
131+
dirs::data_dir()
131132
.expect("Cannot get user's data directory")
132133
.join("openblas_build")
133-
.join(format!("{:x}", hasher.finish()));
134-
output
134+
.join(format!("{:x}", hasher.finish()))
135135
} else {
136136
PathBuf::from(env::var("OUT_DIR").unwrap())
137137
};

0 commit comments

Comments
 (0)