Skip to content

Commit f0d2a57

Browse files
authored
Grab bag refactor (#5)
1 parent 530544a commit f0d2a57

File tree

8 files changed

+1848
-696
lines changed

8 files changed

+1848
-696
lines changed

Cargo.toml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
[package]
22
name = "locator"
3-
version = "1.0.0"
3+
version = "2.0.0"
44
edition = "2021"
55

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

87
[dependencies]
8+
alphanumeric-sort = "1.5.3"
99
getset = "0.1.2"
1010
lazy_static = "1.4.0"
11+
pretty_assertions = "1.4.0"
1112
regex = "1.6.0"
1213
serde = { version = "1.0.140", features = ["derive"] }
1314
strum = { version = "0.24.1", features = ["derive"] }
1415
thiserror = "1.0.31"
1516
typed-builder = "0.10.0"
17+
utoipa = "4.2.3"
18+
serde_json = "1.0.95"
19+
documented = "0.4.1"
20+
semver = "1.0.23"
1621

1722
[dev-dependencies]
1823
assert_matches = "1.5.0"
1924
itertools = "0.10.5"
2025
proptest = "1.0.0"
21-
serde_json = "1.0.95"

src/error.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -45,38 +45,38 @@ pub enum ParseError {
4545
error: strum::ParseError,
4646
},
4747

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

54-
/// The project that was attempted to parse.
55-
project: String,
54+
/// The package that was attempted to parse.
55+
package: String,
5656

5757
/// The error returned by the parser.
5858
#[source]
59-
error: ProjectParseError,
59+
error: PackageParseError,
6060
},
6161
}
6262

63-
/// Errors encountered when parsing the project field
63+
/// Errors encountered when parsing the package field
6464
/// when parsing a [`Locator`](crate::Locator) from a string.
6565
#[derive(Error, Clone, PartialEq, Eq, Debug)]
6666
#[non_exhaustive]
67-
pub enum ProjectParseError {
68-
/// An unsupported value for the "project" field was provided.
69-
#[error("project did not match required syntax: {project}")]
70-
Project {
71-
/// The project input.
72-
project: String,
67+
pub enum PackageParseError {
68+
/// An unsupported value for the "package" field was provided.
69+
#[error("package did not match required syntax: {package}")]
70+
Package {
71+
/// The package input.
72+
package: String,
7373
},
7474

7575
/// The "named" field was missing from the input.
76-
#[error("field '{field}' missing from input: {project}")]
76+
#[error("field '{field}' missing from input: {package}")]
7777
Field {
7878
/// The input originally provided to the parser.
79-
project: String,
79+
package: String,
8080

8181
/// The field that was missing.
8282
field: String,

src/fetcher.rs

-134
This file was deleted.

0 commit comments

Comments
 (0)