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

Fix feature tests #12

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ jobs:
include:
- name: Minimal
runner: test
features: --no-default-features
args: -p purl --no-default-features
- name: Default
runner: test
features: ""
args: -p purl
- name: Full
runner: tarpaulin
features: --all-features
args: --all-features
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -73,4 +73,4 @@ jobs:
rm tarpaulin.tar.gz

- name: Run tests
run: cargo ${{ matrix.runner }} ${{ matrix.features }}
run: cargo ${{ matrix.runner }} ${{ matrix.args }}
5 changes: 2 additions & 3 deletions purl/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ use crate::{GenericPurl, ParseError, PurlParts, PurlShape, SmallString};
/// # Example
///
/// ```
/// // `PurlBuilder` is an alias for `GenericPurlBuilder<PackageType>`.
/// use purl::{PackageType, PurlBuilder};
/// use purl::GenericPurlBuilder;
///
/// // Use the builder if you want to set fields besides the type and name.
/// let purl = PurlBuilder::new(PackageType::Maven, "my-package")
/// let purl = GenericPurlBuilder::new(String::from("maven"), "my-package")
/// .with_namespace("my.company")
/// .build()
/// .unwrap();
Expand Down
10 changes: 7 additions & 3 deletions purl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub use format::*;
pub use package_type::*;
pub use parse::*;
pub use qualifiers::Qualifiers;
#[cfg(feature = "smartstring")]
use smartstring::{LazyCompact, SmartString, SmartStringMode};

mod builder;
Expand Down Expand Up @@ -181,6 +182,7 @@ impl<'a> PurlShape for Cow<'a, str> {
/// Without type-specific functionality, it's possible to create PURLs that have
/// incorrect capitalization or are missing a required namespace or required
/// qualifiers.
#[cfg(feature = "smartstring")]
impl<M> PurlShape for SmartString<M>
where
M: SmartStringMode,
Expand Down Expand Up @@ -229,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());
/// ```
Expand Down
Loading