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

latest clippy lints #139

Merged
merged 1 commit into from
Nov 27, 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: 3 additions & 1 deletion src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7141,7 +7141,7 @@ pub struct _xmlSAXLocator {
/// the application can either:
/// - override this resolveEntity() callback in the SAX block
/// - or better use the xmlSetExternalEntityLoader() function to
/// set up it's own entity resolution routine
/// set up its own entity resolution routine
///
/// Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
pub type resolveEntitySAXFunc = ::std::option::Option<
Expand Down Expand Up @@ -14206,8 +14206,10 @@ pub type xmlXPathFuncLookupFunc = ::std::option::Option<
/// - a set of variable bindings
/// - a function library
/// - the set of namespace declarations in scope for the expression
///
/// Following the switch to hash tables, this need to be trimmed up at
/// the next binary incompatible release.
///
/// The node may be modified when the context is passed to libxml2
/// for an XPath evaluation so you may need to initialize it again
/// before the next call.
Expand Down
6 changes: 3 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub struct ParserOptions<'a> {
pub encoding: Option<&'a str>,
}

impl<'a> ParserOptions<'a> {
impl ParserOptions<'_> {
pub(crate) fn to_flags(&self, format: &ParseFormat) -> i32 {
macro_rules! to_option_flag {
(
Expand Down Expand Up @@ -103,7 +103,7 @@ impl<'a> ParserOptions<'a> {
}
}

impl<'a> Default for ParserOptions<'a> {
impl Default for ParserOptions<'_> {
fn default() -> Self {
ParserOptions {
recover: true,
Expand Down Expand Up @@ -191,7 +191,7 @@ type XmlCloseCallback = unsafe extern "C" fn(*mut c_void) -> c_int;

///Convert usize to i32 safely.
fn try_usize_to_i32(value: usize) -> Result<i32, XmlParseError> {
if cfg!(target_pointer_width = "16") || (value < i32::max_value() as usize) {
if cfg!(target_pointer_width = "16") || (value < i32::MAX as usize) {
// Cannot safely use our value comparison, but the conversion if always safe.
// Or, if the value can be safely represented as a 32-bit signed integer.
Ok(value as i32)
Expand Down
Loading