Skip to content

Commit

Permalink
Enable clippy for pyo3-macros
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Apr 25, 2024
1 parent 3355c93 commit dec500a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyo3-macros/src/lib.rs
@@ -1,6 +1,7 @@
//! This crate declares only the proc macro attributes, as a crate defining proc macro attributes
//! must not contain any other public items.

#![deny(clippy::all, clippy::pedantic, clippy::nursery)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
Expand Down Expand Up @@ -204,7 +205,7 @@ fn pymethods_impl(
.into()
}

fn methods_type() -> PyClassMethodsType {
const fn methods_type() -> PyClassMethodsType {
if cfg!(feature = "multiple-pymethods") {
PyClassMethodsType::Inventory
} else {
Expand All @@ -218,6 +219,6 @@ trait UnwrapOrCompileError {

impl UnwrapOrCompileError for syn::Result<TokenStream2> {
fn unwrap_or_compile_error(self) -> TokenStream2 {
self.unwrap_or_else(|e| e.into_compile_error())
self.unwrap_or_else(syn::Error::into_compile_error)
}
}

0 comments on commit dec500a

Please sign in to comment.