-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`PackageType` is only available with the `package-type` feature. So it's best to avoid it in unrelated doctests. Otherwise, they will fail when run without default features.
- Loading branch information
1 parent
4aaf68c
commit 5e06915
Showing
2 changed files
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -231,11 +231,13 @@ pub struct PurlParts { | |
/// # Example | ||
/// | ||
/// ``` | ||
/// // `Purl` is an alias for `GenericPurl<PackageType>`. | ||
/// use purl::{PackageType, Purl}; | ||
/// use purl::GenericPurl; | ||
/// | ||
/// // Use the builder if you want to set fields besides the type and name. | ||
/// let purl = Purl::builder(PackageType::Npm, "my-package").with_version("1.2.3").build().unwrap(); | ||
/// let purl = GenericPurl::builder(String::from("npm"), "my-package") | ||
/// .with_version("1.2.3") | ||
/// .build() | ||
/// .unwrap(); | ||
/// | ||
/// assert_eq!("pkg:npm/[email protected]", &purl.to_string()); | ||
/// ``` | ||
|