Skip to content

Commit

Permalink
Apply cargo clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibi Braniecki committed Aug 13, 2018
1 parent 214c8b3 commit 7c3e2ad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/locale/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl Locale {
}
}

pub fn remove_variant(&mut self, value: String) {
pub fn remove_variant(&mut self, value: &str) {
if let Some(ref mut variants) = self.variants {
if let Some(position) = variants.iter().position(|x| *x == *value) {
variants.remove(position);
Expand Down Expand Up @@ -200,28 +200,28 @@ impl Locale {
return false;
}

if (!available_range || !self.language.is_none())
if (!available_range || self.language.is_some())
&& (!requested_range || !other.get_language().is_empty())
&& self.get_language() != other.get_language()
{
return false;
}

if (!available_range || !self.script.is_none())
if (!available_range || self.script.is_some())
&& (!requested_range || !other.get_script().is_empty())
&& self.get_script() != other.get_script()
{
return false;
}

if (!available_range || !self.region.is_none())
if (!available_range || self.region.is_some())
&& (!requested_range || !other.get_region().is_empty())
&& self.get_region() != other.get_region()
{
return false;
}

if (!available_range || !self.variants.is_none())
if (!available_range || self.variants.is_some())
&& (!requested_range || !other.get_variants().is_empty())
&& self.get_variants() != other.get_variants()
{
Expand Down

0 comments on commit 7c3e2ad

Please sign in to comment.