mirror of
https://github.com/0x5eal/chrono-lc.git
synced 2024-12-12 12:50:36 +00:00
refactor: modernize codebase for rust edition 2021
This commit is contained in:
parent
9965c3355c
commit
85043c4a3e
14 changed files with 22 additions and 62 deletions
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "chrono_locale"
|
name = "chrono_lc"
|
||||||
version = "0.1.2"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Alessandro Pellizzari <alex@amiran.it>", "Erica Marigold <hi@devcomp.xyz>"]
|
authors = ["Alessandro Pellizzari <alex@amiran.it>", "Erica Marigold <hi@devcomp.xyz>"]
|
||||||
|
|
|
@ -9,14 +9,14 @@ Put this in your Cargo.toml:
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.4.56"
|
chrono = "0.4.56"
|
||||||
chrono_locale = { git = "https://github.com/0x5eal/chrono-locale.git", tag = "v0.1.2" }
|
chrono_lc = "0.1.2"
|
||||||
```
|
```
|
||||||
|
|
||||||
Then put this in your `lib.rs` or `main.rs`:
|
Then put this in your `lib.rs` or `main.rs`:
|
||||||
|
|
||||||
```rs
|
```rs
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
```
|
```
|
||||||
|
|
||||||
You can choose to import just parts of chrono instead of the whole prelude.
|
You can choose to import just parts of chrono instead of the whole prelude.
|
||||||
|
|
7
build.rs
7
build.rs
|
@ -1,9 +1,4 @@
|
||||||
extern crate serde;
|
use serde_derive::Deserialize;
|
||||||
extern crate walkdir;
|
|
||||||
#[macro_use]
|
|
||||||
extern crate serde_derive;
|
|
||||||
extern crate serde_json;
|
|
||||||
|
|
||||||
use serde_json::Error as JsonError;
|
use serde_json::Error as JsonError;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
|
11
src/lib.rs
11
src/lib.rs
|
@ -8,17 +8,14 @@
|
||||||
//! ```toml
|
//! ```toml
|
||||||
//! [dependencies]
|
//! [dependencies]
|
||||||
//! chrono = "0.4"
|
//! chrono = "0.4"
|
||||||
//! chrono_locale = { git = "https://github.com/0x5eal/chrono-locale.git", tag = "v0.1.2" }
|
//! chrono_lc = "0.1.2"
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! Then put this in your `lib.rs` or `main.rs`:
|
//! Then put this in your `lib.rs` or `main.rs`:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! extern crate chrono;
|
|
||||||
//! extern crate chrono_locale;
|
|
||||||
//!
|
|
||||||
//! use chrono::prelude::*;
|
//! use chrono::prelude::*;
|
||||||
//! use chrono_locale::LocaleDate;
|
//! use chrono_lc::LocaleDate;
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! You can choose to import just parts of chrono instead of the whole prelude.
|
//! You can choose to import just parts of chrono instead of the whole prelude.
|
||||||
|
@ -28,7 +25,7 @@
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```rust
|
||||||
//! # use chrono::prelude::*;
|
//! # use chrono::prelude::*;
|
||||||
//! # use chrono_locale::LocaleDate;
|
//! # use chrono_lc::LocaleDate;
|
||||||
//!
|
//!
|
||||||
//! let dt = FixedOffset::east_opt(34200)
|
//! let dt = FixedOffset::east_opt(34200)
|
||||||
//! .unwrap()
|
//! .unwrap()
|
||||||
|
@ -60,8 +57,6 @@
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
extern crate chrono;
|
|
||||||
extern crate num_integer;
|
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
extern crate chrono;
|
|
||||||
extern crate chrono_locale;
|
|
||||||
|
|
||||||
use chrono::{FixedOffset, TimeZone, Timelike};
|
use chrono::{FixedOffset, TimeZone, Timelike};
|
||||||
use chrono_locale::LocaleDate;
|
use chrono_lc::LocaleDate;
|
||||||
|
|
||||||
// This test is copied from chrono's, disabling unsupported features
|
// This test is copied from chrono's, disabling unsupported features
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in a new issue