diff --git a/.clippy.toml b/.clippy.toml index 35c9c11..1781a09 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1 +1 @@ -msrv = "1.65.0" +msrv = "1.75.0" diff --git a/Cargo.toml b/Cargo.toml index 798cc7c..58706ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "sitemap-rs" -version = "0.2.0" +version = "0.2.1" edition = "2021" -rust-version = "1.65" +rust-version = "1.75" authors = ["Todd Everett Griffin "] repository = "https://github.com/goddtriffin/sitemap-rs" homepage = "https://www.toddgriffin.me/" @@ -15,6 +15,23 @@ exclude = [ ".github/*", ] +[lib] +path = "src/lib.rs" + +[lints.rust] +unsafe_code = { level = "forbid", priority = 0 } + +[lints.clippy] +nursery = { level = "allow", priority = 1 } +all = { level = "deny", priority = -1 } +correctness = { level = "deny", priority = -1 } +suspicious = { level = "deny", priority = -1 } +style = { level = "deny", priority = -1 } +complexity = { level = "deny", priority = -1 } +perf = { level = "deny", priority = -1 } +pedantic = { level = "deny", priority = -1 } +cargo = { level = "deny", priority = -1 } + [dependencies] -xml-builder = "0.5.1" -chrono = "0.4.22" +xml-builder = "0.5.2" +chrono = "0.4.33" diff --git a/Makefile b/Makefile index 0b7ae40..3fb4493 100644 --- a/Makefile +++ b/Makefile @@ -27,15 +27,5 @@ lint: ## lints the codebase using rustfmt and Clippy test: ## runs tests cargo fmt --check cargo check - cargo clippy --tests -- \ - -D clippy::all \ - -D clippy::correctness \ - -D clippy::suspicious \ - -D clippy::style \ - -D clippy::complexity \ - -D clippy::perf \ - -D clippy::pedantic \ - -D clippy::cargo \ - -W clippy::nursery \ - -A clippy::multiple_crate_versions + cargo clippy --tests cargo test diff --git a/examples/generate_index_sitemap.rs b/examples/generate_index_sitemap.rs index 5875e87..31776a8 100644 --- a/examples/generate_index_sitemap.rs +++ b/examples/generate_index_sitemap.rs @@ -6,7 +6,7 @@ fn main() { let sitemaps: Vec = vec![ Sitemap::new( String::from("http://www.example.com/sitemap1.xml.gz"), - Some(DateTime::from_utc( + Some(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2004, 10, 1) .unwrap() .and_hms_opt(18, 23, 17) @@ -16,7 +16,7 @@ fn main() { ), Sitemap::new( String::from("http://www.example.com/sitemap2.xml.gz"), - Some(DateTime::from_utc( + Some(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2005, 1, 1) .unwrap() .and_hms_opt(0, 0, 0) diff --git a/examples/generate_news_sitemap.rs b/examples/generate_news_sitemap.rs index 9e55020..726978c 100644 --- a/examples/generate_news_sitemap.rs +++ b/examples/generate_news_sitemap.rs @@ -9,7 +9,7 @@ fn main() { )) .news(News::new( Publication::new(String::from("The Example Times"), String::from("en")), - DateTime::from_utc( + DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2008, 12, 23) .unwrap() .and_hms_opt(0, 0, 0) diff --git a/examples/generate_url_sitemap.rs b/examples/generate_url_sitemap.rs index e90216f..b41a7f9 100644 --- a/examples/generate_url_sitemap.rs +++ b/examples/generate_url_sitemap.rs @@ -4,7 +4,7 @@ use sitemap_rs::url_set::UrlSet; fn main() { let urls: Vec = vec![Url::builder(String::from("http://www.example.com/")) - .last_modified(DateTime::from_utc( + .last_modified(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2005, 1, 1) .unwrap() .and_hms_opt(0, 0, 0) diff --git a/examples/generate_video_sitemap.rs b/examples/generate_video_sitemap.rs index 217bff2..69851bb 100644 --- a/examples/generate_video_sitemap.rs +++ b/examples/generate_video_sitemap.rs @@ -13,7 +13,7 @@ fn main() { String::from("http://www.example.com/videoplayer.php?video=123"), ) .duration(600) - .expiration_date(DateTime::from_utc( + .expiration_date(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2021, 11, 5) .unwrap() .and_hms_opt(11, 20, 30) @@ -22,7 +22,7 @@ fn main() { )) .rating(4.2) .view_count(12345) - .publication_date(DateTime::from_utc( + .publication_date(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2007, 11, 5) .unwrap() .and_hms_opt(11, 20, 30) diff --git a/tests/video.rs b/tests/video.rs index ee5e597..6ad0de2 100644 --- a/tests/video.rs +++ b/tests/video.rs @@ -36,7 +36,7 @@ fn test_constructor_all_fields() { String::from("http://streamserver.example.com/video123.mp4"), String::from("http://www.example.com/videoplayer.php?video=123"), Some(600), - Some(DateTime::from_utc( + Some(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2021, 11, 5) .unwrap() .and_hms_opt(11, 20, 30) @@ -45,7 +45,7 @@ fn test_constructor_all_fields() { )), Some(4.2), Some(12345), - Some(DateTime::from_utc( + Some(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2007, 11, 5) .unwrap() .and_hms_opt(11, 20, 30) diff --git a/tests/video_builder.rs b/tests/video_builder.rs index c1011d3..19db3b6 100644 --- a/tests/video_builder.rs +++ b/tests/video_builder.rs @@ -27,7 +27,7 @@ fn test_all_fields() { String::from("http://www.example.com/videoplayer.php?video=123"), ) .duration(600) - .expiration_date(DateTime::from_utc( + .expiration_date(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2021, 11, 5) .unwrap() .and_hms_opt(11, 20, 30) @@ -36,7 +36,7 @@ fn test_all_fields() { )) .rating(4.2) .view_count(12345) - .publication_date(DateTime::from_utc( + .publication_date(DateTime::from_naive_utc_and_offset( NaiveDate::from_ymd_opt(2007, 11, 5) .unwrap() .and_hms_opt(11, 20, 30)