Skip to content

Commit

Permalink
Fix new beta clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bilelmoussaoui committed Oct 31, 2024
1 parent 3e7e732 commit e9ff881
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/analysis/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ fn find_error_type(env: &Env, function: &Function) -> Option<String> {
.iter()
.find(|param| param.direction.is_out() && param.is_error)?;
if let Type::Record(_) = env.type_(error_param.typ) {
return Some(
Some(
RustType::builder(env, error_param.typ)
.direction(error_param.direction)
.try_build()
.into_string(),
);
)
} else {
None
}
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl IsIncomplete for Field {
}
}

impl<'a> IsIncomplete for &'a [Field] {
impl IsIncomplete for &[Field] {
fn is_incomplete(&self, lib: &Library) -> bool {
if self.is_empty() {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/config/parameter_matchable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub trait ParameterMatchable {
fn matched_parameters(&self, parameter_name: &str) -> Vec<&Self::Parameter>;
}

impl<'a, U: AsRef<Ident>, T: Functionlike<Parameter = U>> ParameterMatchable for [&'a T] {
impl<U: AsRef<Ident>, T: Functionlike<Parameter = U>> ParameterMatchable for [&T] {
type Parameter = U;

fn matched_parameters(&self, parameter_name: &str) -> Vec<&Self::Parameter> {
Expand Down
4 changes: 2 additions & 2 deletions src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ impl Library {
self.namespace_mut(ns_id).versions.insert(version);
}

pub fn types<'a>(&'a self) -> Box<dyn Iterator<Item = (TypeId, &Type)> + 'a> {
pub fn types<'a>(&'a self) -> Box<dyn Iterator<Item = (TypeId, &'a Type)> + 'a> {
Box::new(self.namespaces.iter().enumerate().flat_map(|(ns_id, ns)| {
ns.types.iter().enumerate().filter_map(move |(id, type_)| {
let tid = TypeId {
Expand All @@ -1372,7 +1372,7 @@ impl Library {
pub fn namespace_types<'a>(
&'a self,
ns_id: u16,
) -> Box<dyn Iterator<Item = (TypeId, &Type)> + 'a> {
) -> Box<dyn Iterator<Item = (TypeId, &'a Type)> + 'a> {
let ns = self.namespace(ns_id);
Box::new(ns.index.values().map(move |&id| {
(
Expand Down
2 changes: 1 addition & 1 deletion src/xmlparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl Element {
}
}

impl<'a> XmlParser<'a> {
impl XmlParser<'_> {
pub fn from_path(path: &Path) -> Result<XmlParser<'_>, String> {
match File::open(path) {
Err(e) => Err(format!("Can't open file \"{}\": {}", path.display(), e)),
Expand Down

0 comments on commit e9ff881

Please sign in to comment.