Skip to content

Commit bc2fe55

Browse files
committed
Use unified implementation for ffi::datetime
In the future we can make ffi::object, ffi::pycapsule, etc as crate-public, but importing the specific symbols is a light touch way to do this.
1 parent c784543 commit bc2fe55

File tree

6 files changed

+18
-375
lines changed

6 files changed

+18
-375
lines changed

src/ffi3/datetime.rs renamed to src/ffi/datetime.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use ffi3::object::*;
2-
use ffi3::pycapsule::PyCapsule_Import;
3-
use ffi3::pyport::Py_hash_t;
1+
use ffi::{PyObject, PyTypeObject};
2+
use ffi::{Py_TYPE, PyObject_TypeCheck};
3+
use ffi::PyCapsule_Import;
4+
use ffi::Py_hash_t;
45
use std::ffi::CString;
56
use std::ops::Deref;
67
use std::os::raw::{c_char, c_int, c_uchar};

src/ffi/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
2+
#![cfg_attr(feature="cargo-clippy", allow(inline_always))]
3+
4+
#[cfg(not(Py_3))]
5+
pub use ffi2::*;
6+
7+
#[cfg(Py_3)]
8+
pub use ffi3::*;
9+
10+
pub use self::datetime::*;
11+
12+
pub(crate) mod datetime;

src/ffi2/datetime.rs

Lines changed: 0 additions & 357 deletions
This file was deleted.

src/ffi2/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub use self::cobject::*;
1616
pub use self::code::*;
1717
pub use self::compile::*;
1818
pub use self::complexobject::*;
19-
pub use self::datetime::*;
2019
pub use self::descrobject::*;
2120
pub use self::dictobject::*;
2221
pub use self::enumobject::*;
@@ -67,7 +66,6 @@ mod cellobject;
6766
mod classobject;
6867
mod cobject;
6968
mod complexobject;
70-
mod datetime;
7169
mod descrobject;
7270
mod dictobject;
7371
mod enumobject;

0 commit comments

Comments
 (0)