refactor: modernize codebase for rust edition 2021

This commit is contained in:
Erica Marigold 2023-09-06 13:05:18 +05:30
parent 9965c3355c
commit 85043c4a3e
No known key found for this signature in database
GPG key ID: 23CD97ABBBCC5ED2
14 changed files with 22 additions and 62 deletions

View file

@ -1,5 +1,5 @@
[package]
name = "chrono_locale"
name = "chrono_lc"
version = "0.1.2"
edition = "2021"
authors = ["Alessandro Pellizzari <alex@amiran.it>", "Erica Marigold <hi@devcomp.xyz>"]

View file

@ -9,14 +9,14 @@ Put this in your Cargo.toml:
```toml
[dependencies]
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`:
```rs
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.

View file

@ -1,9 +1,4 @@
extern crate serde;
extern crate walkdir;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
use serde_derive::Deserialize;
use serde_json::Error as JsonError;
use std::env;
use std::fs::File;

View file

@ -8,17 +8,14 @@
//! ```toml
//! [dependencies]
//! 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`:
//!
//! ```rust
//! extern crate chrono;
//! extern crate chrono_locale;
//!
//! 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.
@ -28,7 +25,7 @@
//!
//! ```rust
//! # use chrono::prelude::*;
//! # use chrono_locale::LocaleDate;
//! # use chrono_lc::LocaleDate;
//!
//! let dt = FixedOffset::east_opt(34200)
//! .unwrap()
@ -60,8 +57,6 @@
#[macro_use]
extern crate lazy_static;
extern crate chrono;
extern crate num_integer;
use std::collections::HashMap;
use std::fmt;

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]

View file

@ -1,8 +1,5 @@
extern crate chrono;
extern crate chrono_locale;
use chrono::{FixedOffset, TimeZone, Timelike};
use chrono_locale::LocaleDate;
use chrono_lc::LocaleDate;
// This test is copied from chrono's, disabling unsupported features
#[test]