Skip to content

Commit

Permalink
Bump library version to 0.2.1. Bump MSRV to 1.75. Migrate lints from …
Browse files Browse the repository at this point in the history
…Makefile to Cargo.toml. Bump all dependency versions to latest. Replace newly deprecated functions with recommended replacements.
  • Loading branch information
goddtriffin committed Feb 7, 2024
1 parent 760879e commit a5f2fcc
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.65.0"
msrv = "1.75.0"
25 changes: 21 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
repository = "https://github.com/goddtriffin/sitemap-rs"
homepage = "https://www.toddgriffin.me/"
Expand All @@ -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"
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions examples/generate_index_sitemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
let sitemaps: Vec<Sitemap> = 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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/generate_news_sitemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/generate_url_sitemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use sitemap_rs::url_set::UrlSet;

fn main() {
let urls: Vec<Url> = 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)
Expand Down
4 changes: 2 additions & 2 deletions examples/generate_video_sitemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/video_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit a5f2fcc

Please sign in to comment.