Skip to content

Commit

Permalink
port to Rust 2018 Edition
Browse files Browse the repository at this point in the history
  • Loading branch information
felipenoris committed Sep 15, 2019
1 parent be4a87c commit fdcb49c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
[package]
name = "bdays"
version = "0.0.2"
version = "0.1.0"
authors = ["Felipe Noronha <[email protected]>"]
license = "MIT"
description = "Business Days calendars for Rustaceans."
homepage = "https://github.com/felipenoris/bdays"
documentation = "https://docs.rs/bdays"
repository = "https://github.com/felipenoris/bdays"
keywords = ["date", "calendar"]
keywords = ["date", "calendar", "finance"]
categories = ["date-and-time"]
readme = "README.md"
edition = "2018"

[badges]
travis-ci = { repository = "felipenoris/bdays" }

[dependencies]
chrono = "0.4.6"
chrono = "0.4"

[dev-dependencies]
bencher = "0.1.5"
bencher = "0.1"

[[bench]]
name = "bench"
harness = false
harness = false
4 changes: 2 additions & 2 deletions src/calendars/mod.rs → src/calendars.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

use HolidayCalendar;
use chrono::Datelike;
use crate::HolidayCalendar;
use ::chrono::Datelike;

/// Holiday Calendars for Brazil.
pub mod brazil;
Expand Down
6 changes: 3 additions & 3 deletions src/calendars/brazil.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

use chrono::{Datelike, Weekday};
use HolidayCalendar;
use easter;
use ::chrono::{Datelike, Weekday};
use crate::HolidayCalendar;
use crate::easter;

/// Brazilian banking holidays.
/// This calendar is defined by brazilian federal holidays plus Carnival.
Expand Down
5 changes: 2 additions & 3 deletions src/calendars/us.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

use chrono::{Datelike, Weekday, NaiveDate, Duration};
use HolidayCalendar;
use easter;
use ::chrono::{Datelike, Weekday, NaiveDate, Duration};
use crate::HolidayCalendar;

/// United States federal holidays.
pub struct USSettlement;
Expand Down
14 changes: 2 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
//! # Usage
//!
//! ```rust
//! extern crate bdays;
//! extern crate chrono;
//!
//! use chrono::NaiveDate;
//! use bdays::HolidayCalendar;
//!
Expand Down Expand Up @@ -57,9 +54,6 @@
//! As a motivation, this example might take some time to finish.
//!
//! ```rust
//! extern crate bdays;
//! extern crate chrono;
//!
//! use chrono::NaiveDate;
//! use bdays::HolidayCalendar;
//!
Expand All @@ -76,9 +70,6 @@
//! for a given range of dates.
//!
//! ```rust
//! extern crate bdays;
//! extern crate chrono;
//!
//! use chrono::NaiveDate;
//! use bdays::HolidayCalendar;
//!
Expand All @@ -96,11 +87,10 @@
//! }
//! ```

extern crate chrono;

use std::fmt::Display;
use chrono::Datelike;
use chrono::Weekday;

use std::fmt::Display;
use std::cmp::PartialOrd;

/// Algorithms to calculate easter dates.
Expand Down

0 comments on commit fdcb49c

Please sign in to comment.