Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grab bag refactor #5

Merged
merged 13 commits into from
Jun 5, 2024
10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
[package]
name = "locator"
version = "1.0.0"
version = "2.0.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
alphanumeric-sort = "1.5.3"
getset = "0.1.2"
lazy_static = "1.4.0"
pretty_assertions = "1.4.0"
regex = "1.6.0"
serde = { version = "1.0.140", features = ["derive"] }
strum = { version = "0.24.1", features = ["derive"] }
thiserror = "1.0.31"
typed-builder = "0.10.0"
utoipa = "4.2.3"
serde_json = "1.0.95"
documented = "0.4.1"
semver = "1.0.23"

[dev-dependencies]
assert_matches = "1.5.0"
itertools = "0.10.5"
proptest = "1.0.0"
serde_json = "1.0.95"
30 changes: 15 additions & 15 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,38 @@ pub enum ParseError {
error: strum::ParseError,
},

/// An unsupported value for the "project" field was provided.
#[error("invalid project '{project}' in input '{input}'")]
Project {
/// An unsupported value for the "package" field was provided.
#[error("invalid package '{package}' in input '{input}'")]
Package {
/// The input originally provided to the parser.
input: String,

/// The project that was attempted to parse.
project: String,
/// The package that was attempted to parse.
package: String,

/// The error returned by the parser.
#[source]
error: ProjectParseError,
error: PackageParseError,
},
}

/// Errors encountered when parsing the project field
/// Errors encountered when parsing the package field
/// when parsing a [`Locator`](crate::Locator) from a string.
#[derive(Error, Clone, PartialEq, Eq, Debug)]
#[non_exhaustive]
pub enum ProjectParseError {
/// An unsupported value for the "project" field was provided.
#[error("project did not match required syntax: {project}")]
Project {
/// The project input.
project: String,
pub enum PackageParseError {
/// An unsupported value for the "package" field was provided.
#[error("package did not match required syntax: {package}")]
Package {
/// The package input.
package: String,
},

/// The "named" field was missing from the input.
#[error("field '{field}' missing from input: {project}")]
#[error("field '{field}' missing from input: {package}")]
Field {
/// The input originally provided to the parser.
project: String,
package: String,

/// The field that was missing.
field: String,
Expand Down
134 changes: 0 additions & 134 deletions src/fetcher.rs

This file was deleted.

Loading
Loading