Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,37 @@ path = "src/main.rs"

[dependencies]
# Dependencies required for building and running the project.
clap = "4.5"
clap = "4.5.23"
dtt = "0.0.8"
env_logger = "0.11"
html-generator = "0.0.2"
indicatif = "0.17"
lazy_static = "1.5"
log = "0.4"
regex = "1.11"
scraper = "0.22"
tempfile = "3.13"
thiserror = "2.0"
time = "0.3"
tokio = "1.40"
url = "2.5"
xml-rs = "0.8"
env_logger = "0.11.6"
indicatif = "0.17.9"
lazy_static = "1.5.0"
log = "0.4.22"
regex = "1.11.1"
tempfile = "3.14.0"
thiserror = "2.0.9"
time = "0.3.37"
url = "2.5.4"
xml-rs = "0.8.24"

# -----------------------------------------------------------------------------
# Build Dependencies
# -----------------------------------------------------------------------------

[build-dependencies]
# Dependencies for build scripts.
version_check = "0.9"
version_check = "0.9.5"

# -----------------------------------------------------------------------------
# Development Dependencies
# -----------------------------------------------------------------------------

[dev-dependencies]
# Dependencies required for testing and development.
criterion = "0.5"
assert_fs = "1.1"
predicates = "3.1"
pretty_assertions = "1.4"
criterion = "0.5.1"
assert_fs = "1.1.2"
predicates = "3.1.3"
pretty_assertions = "1.4.1"

# -----------------------------------------------------------------------------
# Examples
Expand Down
26 changes: 15 additions & 11 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright © 2025 Sitemap Gen. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT

//! Error types for the sitemap library.
//!
//! This module defines various error types that can occur during sitemap operations,
Expand All @@ -21,7 +24,7 @@
/// without breaking backwards compatibility.
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum SitemapError {

Check failure on line 27 in src/error.rs

View workflow job for this annotation

GitHub Actions / Lint

item name ends with its containing module's name
/// Error occurred during XML writing.
#[error("XML writing error: {0}")]
XmlWriteError(#[from] xml::writer::Error),
Expand Down Expand Up @@ -72,18 +75,19 @@
///
/// # Returns
/// A string slice describing the context of the error.
pub fn context(&self) -> &'static str {
#[must_use]
pub const fn context(&self) -> &'static str {
match self {
SitemapError::XmlWriteError(_) => "Error occurred while writing XML data",
SitemapError::XmlParseError(_) => "Error occurred while parsing XML data",
SitemapError::DateError(_) => "Error occurred while parsing or formatting dates",
SitemapError::UrlError(_) => "Error occurred while parsing URLs",
SitemapError::IoError(_) => "Error occurred during file or network operations",
SitemapError::EncodingError(_) => "Error occurred during UTF-8 string encoding or decoding",
SitemapError::InvalidChangeFreq(_) => "An invalid change frequency value was provided",
SitemapError::CustomError(_) => "An unexpected error occurred",
SitemapError::SitemapTooLarge => "The generated sitemap exceeds the maximum allowed size",
SitemapError::MaxUrlLimitExceeded(_) => "The number of URLs exceeds the maximum allowed limit",
Self::XmlWriteError(_) => "Error occurred while writing XML data",
Self::XmlParseError(_) => "Error occurred while parsing XML data",
Self::DateError(_) => "Error occurred while parsing or formatting dates",
Self::UrlError(_) => "Error occurred while parsing URLs",
Self::IoError(_) => "Error occurred during file or network operations",
Self::EncodingError(_) => "Error occurred during UTF-8 string encoding or decoding",
Self::InvalidChangeFreq(_) => "An invalid change frequency value was provided",
Self::CustomError(_) => "An unexpected error occurred",
Self::SitemapTooLarge => "The generated sitemap exceeds the maximum allowed size",
Self::MaxUrlLimitExceeded(_) => "The number of URLs exceeds the maximum allowed limit",
}
}
}
Expand Down
Loading
Loading