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

Fix new beta clippy warnings #1611

Merged
merged 1 commit into from
Oct 31, 2024
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
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
Loading