Skip to content

Commit ff4df27

Browse files
committed
fix linting errors
1 parent 2028880 commit ff4df27

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

src/input/input_python.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::str::from_utf8;
33
use pyo3::intern;
44
use pyo3::prelude::*;
55

6-
use pyo3::sync::PyOnceLock;
76
use pyo3::types::PyType;
87
use pyo3::types::{
98
PyBool, PyByteArray, PyBytes, PyComplex, PyDate, PyDateTime, PyDict, PyFloat, PyFrozenSet, PyInt, PyIterator,
@@ -49,8 +48,6 @@ use super::{
4948
Input,
5049
};
5150

52-
53-
5451
pub(crate) fn downcast_python_input<'py, T: PyTypeCheck>(input: &(impl Input<'py> + ?Sized)) -> Option<&Bound<'py, T>> {
5552
input.as_python().and_then(|any| any.downcast::<T>().ok())
5653
}

src/input/shared.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub fn decimal_as_int<'py>(
231231
pub fn fraction_as_int<'py>(
232232
input: &(impl Input<'py> + ?Sized),
233233
fraction: &Bound<'py, PyAny>,
234-
) -> ValResult<EitherInt<'py>> {
234+
) -> ValResult<EitherInt<'py>> {
235235
let py = fraction.py();
236236

237237
let (numerator, denominator) = fraction
@@ -241,5 +241,4 @@ pub fn fraction_as_int<'py>(
241241
return Err(ValError::new(ErrorTypeDefaults::IntFromFloat, input));
242242
}
243243
Ok(EitherInt::Py(numerator))
244-
245244
}

src/validators/fraction.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use pyo3::types::{PyDict, PyString, PyType};
77
use pyo3::{prelude::*, PyTypeInfo};
88

99
use crate::build_tools::is_strict;
10-
use crate::errors::ValResult;
1110
use crate::errors::ErrorTypeDefaults;
11+
use crate::errors::ValResult;
1212
use crate::errors::{ToErrorValue, ValError};
1313
use crate::input::Input;
1414

@@ -75,15 +75,6 @@ impl BuildValidator for FractionValidator {
7575

7676
impl_py_gc_traverse!(FractionValidator { le, lt, ge, gt });
7777

78-
fn extract_fraction_as_ints(fraction: &Bound<'_, PyAny>) -> ValResult<(i64, i64)> {
79-
let py = fraction.py();
80-
// just call fraction.numerator and fraction.denominator
81-
let numerator: i64 = fraction.getattr(intern!(py, "numerator"))?.extract()?;
82-
let denominator: i64 = fraction.getattr(intern!(py, "denominator"))?.extract()?;
83-
84-
Ok((numerator, denominator))
85-
}
86-
8778
impl Validator for FractionValidator {
8879
fn validate<'py>(
8980
&self,

0 commit comments

Comments
 (0)