chore: Fix several style lints (#17488)
It's not comprehensive enough to start linting on `style` group, but hey, it's a start. Release Notes: - N/A
This commit is contained in:
@@ -234,8 +234,8 @@ impl Eq for PathMatcher {}
|
||||
impl PathMatcher {
|
||||
pub fn new(globs: &[String]) -> Result<Self, globset::Error> {
|
||||
let globs = globs
|
||||
.into_iter()
|
||||
.map(|glob| Glob::new(&glob))
|
||||
.iter()
|
||||
.map(|glob| Glob::new(glob))
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let sources = globs.iter().map(|glob| glob.glob().to_owned()).collect();
|
||||
let mut glob_builder = GlobSetBuilder::new();
|
||||
@@ -263,7 +263,7 @@ impl PathMatcher {
|
||||
let path_str = path.to_string_lossy();
|
||||
let separator = std::path::MAIN_SEPARATOR_STR;
|
||||
if path_str.ends_with(separator) {
|
||||
return false;
|
||||
false
|
||||
} else {
|
||||
self.glob.is_match(path_str.to_string() + separator)
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ pub fn parse_env_output(env: &str, mut f: impl FnMut(String, String)) {
|
||||
|
||||
for line in env.split_terminator('\n') {
|
||||
if let Some(separator_index) = line.find('=') {
|
||||
if &line[..separator_index] != "" {
|
||||
if !line[..separator_index].is_empty() {
|
||||
if let Some((key, value)) = Option::zip(current_key.take(), current_value.take()) {
|
||||
f(key, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user