Skip to content

Commit

Permalink
use valid package name
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-phylum committed Apr 4, 2023
1 parent e8ac09b commit bde99a0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions purl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,10 @@ pub struct PurlParts {
/// use phylum_purl::{PackageType, Purl};
///
/// // Use the builder if you want to set fields besides the type and name.
/// let purl = Purl::builder(PackageType::Npm, "@my-company/my-package")
/// .with_version(Some("1.2.3"))
/// .build()
/// .unwrap();
/// let purl =
/// Purl::builder(PackageType::Npm, "my-package").with_version(Some("1.2.3")).build().unwrap();
///
/// assert_eq!("pkg:npm/%40my-company%2Fmy[email protected]", &purl.to_string());
/// assert_eq!("pkg:npm/my[email protected]", &purl.to_string());
/// ```
///
/// # See also
Expand Down

3 comments on commit bde99a0

@Allan-Clements
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the @my-company scope not valid?

@matt-phylum
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should have been a namespace. It's easier to just not have it in this example.

@Allan-Clements
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I see that now. 👍

Please sign in to comment.