language changes: #[]; -> #![], priv fields by default; added .travis.yml.

This commit is contained in:
Kang Seonghoon 2014-04-02 01:30:52 +09:00
parent 0f6ccf0728
commit 5516dc630d
5 changed files with 30 additions and 8 deletions

12
.travis.yml Normal file
View File

@ -0,0 +1,12 @@
before_install:
- yes | sudo add-apt-repository ppa:hansjorg/rust
- sudo apt-get update
install:
- sudo apt-get install rust-nightly
script:
- ./configure
- make check RUSTFLAGS=
- make doc
branches:
only:
- master

View File

@ -206,7 +206,7 @@ pub trait Datelike {
/// Also supports the conversion from ISO 8601 ordinal and week date.
#[deriving(Eq, TotalEq, Ord, TotalOrd, Hash)]
pub struct DateZ {
priv ymdf: DateImpl, // (year << 13) | of
ymdf: DateImpl, // (year << 13) | of
}
impl DateZ {

View File

@ -46,6 +46,16 @@ impl DateTimeZ {
}
}
#[inline]
pub fn date(&self) -> DateZ {
self.date
}
#[inline]
pub fn time(&self) -> TimeZ {
self.time
}
/// Returns the number of non-leap seconds since January 1, 1970 0:00:00.
/// Note that this does *not* account for the timezone!
#[inline]

View File

@ -10,9 +10,9 @@ static SECS_PER_DAY: int = 86400;
#[deriving(Eq, TotalEq, Ord, TotalOrd)]
pub struct Duration {
priv days: int,
priv secs: u32,
priv nanos: u32,
days: int,
secs: u32,
nanos: u32,
}
impl Duration {

View File

@ -61,10 +61,10 @@ pub trait Timelike {
/// Allows for the nanosecond precision and optional leap second representation.
#[deriving(Eq, TotalEq, Ord, TotalOrd, Hash)]
pub struct TimeZ {
priv hour: u8,
priv min: u8,
priv sec: u8,
priv frac: u32,
hour: u8,
min: u8,
sec: u8,
frac: u32,
}
impl TimeZ {