}
/// A record specifying a time value in seconds and nanoseconds.
-#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Show)]
+#[deriving(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Show)]
pub struct Timespec {
pub sec: i64,
pub nsec: i32,
}
-impl Copy for Timespec {}
-
/*
* Timespec assumes that pre-epoch Timespecs have negative sec and positive
* nsec fields. Darwin's and Linux's struct timespec functions handle pre-
/// also called a broken-down time value.
// FIXME: use c_int instead of i32?
#[repr(C)]
-#[deriving(Clone, PartialEq, Eq, Show)]
+#[deriving(Clone, Copy, PartialEq, Eq, Show)]
pub struct Tm {
/// Seconds after the minute - [0, 60]
pub tm_sec: i32,
pub tm_nsec: i32,
}
-impl Copy for Tm {}
-
pub fn empty_tm() -> Tm {
Tm {
tm_sec: 0_i32,
}
}
-#[deriving(PartialEq)]
+#[deriving(Copy, PartialEq)]
pub enum ParseError {
InvalidSecond,
InvalidMinute,
UnexpectedCharacter(char, char),
}
-impl Copy for ParseError {}
-
impl Show for ParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {