diff --git a/src/objects/datetime.rs b/src/objects/datetime.rs index d742ff83..17e48f28 100644 --- a/src/objects/datetime.rs +++ b/src/objects/datetime.rs @@ -27,19 +27,19 @@ use instance::Py; use python::{Python, ToPyPointer}; // Traits -pub trait PyDateComponentAccess { +pub trait PyDateAccess { fn get_year(&self) -> u32; fn get_month(&self) -> u32; fn get_day(&self) -> u32; } -pub trait PyDeltaComponentAccess { +pub trait PyDeltaAccess { fn get_days(&self) -> i32; fn get_seconds(&self) -> i32; fn get_microseconds(&self) -> i32; } -pub trait PyTimeComponentAccess { +pub trait PyTimeAccess { fn get_hour(&self) -> u32; fn get_minute(&self) -> u32; fn get_second(&self) -> u32; @@ -73,7 +73,7 @@ impl PyDate { } } -impl PyDateComponentAccess for PyDate { +impl PyDateAccess for PyDate { fn get_year(&self) -> u32 { unsafe { PyDateTime_GET_YEAR(self.as_ptr()) as u32 } } @@ -138,7 +138,7 @@ impl PyDateTime { } } -impl PyDateComponentAccess for PyDateTime { +impl PyDateAccess for PyDateTime { fn get_year(&self) -> u32 { unsafe { PyDateTime_GET_YEAR(self.as_ptr()) as u32 } } @@ -152,7 +152,7 @@ impl PyDateComponentAccess for PyDateTime { } } -impl PyTimeComponentAccess for PyDateTime { +impl PyTimeAccess for PyDateTime { fn get_hour(&self) -> u32 { unsafe { PyDateTime_DATE_GET_HOUR(self.as_ptr()) as u32 } } @@ -232,7 +232,7 @@ impl PyTime { } } -impl PyTimeComponentAccess for PyTime { +impl PyTimeAccess for PyTime { fn get_hour(&self) -> u32 { unsafe { PyDateTime_TIME_GET_HOUR(self.as_ptr()) as u32 } } @@ -284,7 +284,7 @@ impl PyDelta { } } -impl PyDeltaComponentAccess for PyDelta { +impl PyDeltaAccess for PyDelta { fn get_days(&self) -> i32 { unsafe { PyDateTime_DELTA_GET_DAYS(self.as_ptr()) as i32 } } diff --git a/src/objects/mod.rs b/src/objects/mod.rs index 29105349..1181c7a6 100644 --- a/src/objects/mod.rs +++ b/src/objects/mod.rs @@ -5,9 +5,9 @@ mod exc_impl; pub use self::boolobject::PyBool; pub use self::bytearray::PyByteArray; -pub use self::datetime::PyDeltaComponentAccess; +pub use self::datetime::PyDeltaAccess; pub use self::datetime::{PyDate, PyDateTime, PyDelta, PyTime, PyTzInfo}; -pub use self::datetime::{PyDateComponentAccess, PyTimeComponentAccess}; +pub use self::datetime::{PyDateAccess, PyTimeAccess}; pub use self::dict::PyDict; pub use self::floatob::PyFloat; pub use self::iterator::PyIterator; diff --git a/tests/rustapi_module/src/lib.rs b/tests/rustapi_module/src/lib.rs index a69e2dde..2182ddc5 100644 --- a/tests/rustapi_module/src/lib.rs +++ b/tests/rustapi_module/src/lib.rs @@ -3,12 +3,12 @@ #[macro_use] extern crate pyo3; -use pyo3::prelude::PyDeltaComponentAccess; +use pyo3::prelude::PyDeltaAccess; use pyo3::prelude::PyModule; use pyo3::prelude::PyObject; use pyo3::prelude::{pyfunction, pymodinit}; use pyo3::prelude::{PyDate, PyDateTime, PyDelta, PyTime, PyTzInfo}; -use pyo3::prelude::{PyDateComponentAccess, PyTimeComponentAccess}; +use pyo3::prelude::{PyDateAccess, PyTimeAccess}; use pyo3::prelude::{PyDict, PyTuple}; use pyo3::{ObjectProtocol, ToPyObject}; use pyo3::{Py, PyResult, Python};