Skip to content

Commit c784543

Browse files
committed
Remove 'Component' from ComponentAccess Traits
1 parent 1074e5f commit c784543

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/objects/datetime.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ use instance::Py;
2727
use python::{Python, ToPyPointer};
2828

2929
// Traits
30-
pub trait PyDateComponentAccess {
30+
pub trait PyDateAccess {
3131
fn get_year(&self) -> u32;
3232
fn get_month(&self) -> u32;
3333
fn get_day(&self) -> u32;
3434
}
3535

36-
pub trait PyDeltaComponentAccess {
36+
pub trait PyDeltaAccess {
3737
fn get_days(&self) -> i32;
3838
fn get_seconds(&self) -> i32;
3939
fn get_microseconds(&self) -> i32;
4040
}
4141

42-
pub trait PyTimeComponentAccess {
42+
pub trait PyTimeAccess {
4343
fn get_hour(&self) -> u32;
4444
fn get_minute(&self) -> u32;
4545
fn get_second(&self) -> u32;
@@ -73,7 +73,7 @@ impl PyDate {
7373
}
7474
}
7575

76-
impl PyDateComponentAccess for PyDate {
76+
impl PyDateAccess for PyDate {
7777
fn get_year(&self) -> u32 {
7878
unsafe { PyDateTime_GET_YEAR(self.as_ptr()) as u32 }
7979
}
@@ -138,7 +138,7 @@ impl PyDateTime {
138138
}
139139
}
140140

141-
impl PyDateComponentAccess for PyDateTime {
141+
impl PyDateAccess for PyDateTime {
142142
fn get_year(&self) -> u32 {
143143
unsafe { PyDateTime_GET_YEAR(self.as_ptr()) as u32 }
144144
}
@@ -152,7 +152,7 @@ impl PyDateComponentAccess for PyDateTime {
152152
}
153153
}
154154

155-
impl PyTimeComponentAccess for PyDateTime {
155+
impl PyTimeAccess for PyDateTime {
156156
fn get_hour(&self) -> u32 {
157157
unsafe { PyDateTime_DATE_GET_HOUR(self.as_ptr()) as u32 }
158158
}
@@ -231,7 +231,7 @@ impl PyTime {
231231
}
232232
}
233233

234-
impl PyTimeComponentAccess for PyTime {
234+
impl PyTimeAccess for PyTime {
235235
fn get_hour(&self) -> u32 {
236236
unsafe { PyDateTime_TIME_GET_HOUR(self.as_ptr()) as u32 }
237237
}
@@ -283,7 +283,7 @@ impl PyDelta {
283283
}
284284
}
285285

286-
impl PyDeltaComponentAccess for PyDelta {
286+
impl PyDeltaAccess for PyDelta {
287287
fn get_days(&self) -> i32 {
288288
unsafe { PyDateTime_DELTA_GET_DAYS(self.as_ptr()) as i32 }
289289
}

src/objects/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ mod exc_impl;
55

66
pub use self::boolobject::PyBool;
77
pub use self::bytearray::PyByteArray;
8-
pub use self::datetime::PyDeltaComponentAccess;
8+
pub use self::datetime::PyDeltaAccess;
99
pub use self::datetime::{PyDate, PyDateTime, PyDelta, PyTime, PyTzInfo};
10-
pub use self::datetime::{PyDateComponentAccess, PyTimeComponentAccess};
10+
pub use self::datetime::{PyDateAccess, PyTimeAccess};
1111
pub use self::dict::PyDict;
1212
pub use self::floatob::PyFloat;
1313
pub use self::iterator::PyIterator;

tests/rustapi_module/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
#[macro_use]
44
extern crate pyo3;
55

6-
use pyo3::prelude::PyDeltaComponentAccess;
6+
use pyo3::prelude::PyDeltaAccess;
77
use pyo3::prelude::PyModule;
88
use pyo3::prelude::PyObject;
99
use pyo3::prelude::{pyfunction, pymodinit};
1010
use pyo3::prelude::{PyDate, PyDateTime, PyDelta, PyTime, PyTzInfo};
11-
use pyo3::prelude::{PyDateComponentAccess, PyTimeComponentAccess};
11+
use pyo3::prelude::{PyDateAccess, PyTimeAccess};
1212
use pyo3::prelude::{PyDict, PyTuple};
1313
use pyo3::{ObjectProtocol, ToPyObject};
1414
use pyo3::{Py, PyResult, Python};

0 commit comments

Comments
 (0)