Skip to content

Commit 7da91cf

Browse files
authored
Merge pull request #173 from artichoke/dev/lopopolo-core-ffi
2 parents 2f0ab4a + efe113c commit 7da91cf

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/format/mod.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ mod utils;
66
mod week;
77
mod write;
88

9+
use core::ffi::c_int;
910
use core::fmt;
1011
use core::num::IntErrorKind;
1112
use core::str;
@@ -21,13 +22,6 @@ pub(crate) use write::FmtWrite;
2122
#[cfg(feature = "std")]
2223
pub(crate) use write::IoWrite;
2324

24-
/// Alias to a `c_int`.
25-
#[cfg(feature = "std")]
26-
type Int = std::os::raw::c_int;
27-
/// Fallback alias to a `c_int`.
28-
#[cfg(not(feature = "std"))]
29-
type Int = i32;
30-
3125
/// List of weekday names.
3226
const DAYS: [&str; 7] = [
3327
"Sunday",
@@ -810,7 +804,7 @@ impl<'t, 'f, T: CheckedTime> TimeFormatter<'t, 'f, T> {
810804
.expect("reading ASCII digits should yield a valid UTF-8 slice");
811805

812806
let width = match width_digits.parse::<usize>() {
813-
Ok(width) if Int::try_from(width).is_ok() => Some(width),
807+
Ok(width) if c_int::try_from(width).is_ok() => Some(width),
814808
Err(err) if *err.kind() == IntErrorKind::Empty => None,
815809
_ => return Ok(None),
816810
};

0 commit comments

Comments
 (0)