diff --git a/CHANGELOG.md b/CHANGELOG.md index f4f22a4..14164bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.0](https://github.com/tjtelan/git-url-parse-rs/compare/v0.5.3...v0.6.0) - 2025-09-18 + +### Added + +- Add interoperable support for `url::Url` ([#74](https://github.com/tjtelan/git-url-parse-rs/pull/74)) + +### Other + +- Remove lifetime from GitUrl ([#72](https://github.com/tjtelan/git-url-parse-rs/pull/72)) + ## [0.5.3](https://github.com/tjtelan/git-url-parse-rs/compare/v0.5.2...v0.5.3) - 2025-09-17 ### Fixed diff --git a/Cargo.toml b/Cargo.toml index 2950336..10b4389 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" name = "git-url-parse" readme = "README.md" repository = "https://github.com/tjtelan/git-url-parse-rs" -version = "0.5.3" +version = "0.6.0" rust-version = "1.85" [features] diff --git a/README.md b/README.md index f6b1eea..0c1b3be 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ Parses url used by git (e.g. `git clone `) - 🏗️ Host provider info extraction - Easy to implement trait [`GitProvider`](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/trait.GitProvider.html) for custom provider parsing - Built-in support for multiple Git hosting providers - * [Generic](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/struct.GenericProvider.html) (`git@host:owner/repo.git` style urls) - * [GitLab](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/struct.GitLabProvider.html) - * [Azure DevOps](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/struct.AzureDevOpsProvider.html) + * [Generic](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/generic/struct.GenericProvider.html) (`git@host:owner/repo.git` style urls) + * [GitLab](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/gitlab/struct.GitLabProvider.html) + * [Azure DevOps](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/azure_devops/struct.AzureDevOpsProvider.html) ## Quick Example @@ -58,7 +58,7 @@ fn main() -> Result<(), git_url_parse::GitUrlParseError> { #[derive(Debug, Clone, PartialEq, Eq)] struct CustomProvider; - impl GitProvider, GitUrlParseError> for CustomProvider { + impl GitProvider for CustomProvider { fn from_git_url(_url: &GitUrl) -> Result { // Your custom provider parsing here Ok(Self) @@ -98,7 +98,12 @@ Enable for [serde](https://docs.rs/serde/latest/) `Serialize`/`Deserialize` on [ #### `url` (**enabled by default**) -Uses [url](https://docs.rs/url/latest/) during parsing for full url validation +`GitUrl` parsing finishes with [url](https://docs.rs/url/latest/) during parsing for full url validation + +[`GitUrl::parse_to_url`] will normalize an ssh-based url and return [`url::Url`](https://docs.rs/url/latest/url/struct.Url.html) + +You can use `url::Url` with the built-in [`GitProvider`](https://docs.rs/git-url-parse/latest/git_url_parse/types/provider/trait.GitProvider.html) host parsers. See the `url_interop` tests for examples +