Skip to content

Commit

Permalink
update with latest clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev committed Nov 27, 2024
1 parent 2380450 commit f0f8ce2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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

0 comments on commit f0f8ce2

Please sign in to comment.