Skip to content

Commit

Permalink
expose library api
Browse files Browse the repository at this point in the history
  • Loading branch information
jhheider committed Jan 1, 2025
1 parent 7a2d166 commit c934210
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "semverator"
version = "0.7.0"
version = "0.7.1"
edition = "2021"
license = "Apache-2.0"
readme = "../README.md"
Expand All @@ -13,7 +13,7 @@ categories = ["command-line-utilities"]
[dependencies]
anyhow = "1.0.75"
clap = { version = '4.4.2', features = ['cargo'] }
libsemverator = { path = "../lib", version = "0.7.0" }
libsemverator = { path = "../lib", version = "0.7.1" }

[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(tarpaulin_include)'] }
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libsemverator"
version = "0.7.0"
version = "0.7.1"
edition = "2021"
license = "Apache-2.0"
readme = "../README.md"
Expand Down
8 changes: 4 additions & 4 deletions lib/src/range/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::semver::Semver;
use std::hash::{Hash, Hasher};

mod intersect;
mod max;
mod parse;
mod satisfies;
pub mod intersect;
pub mod max;
pub mod parse;
pub mod satisfies;

#[derive(Debug, Clone)]
pub struct Range {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/range/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl Range {
}

impl Constraint {
fn parse(constraint: &str) -> Result<Self> {
pub fn parse(constraint: &str) -> Result<Self> {
let re = Regex::new(r"^>=((\d+\.)*\d+)\s*(<((\d+\.)*\d+))?$")?;
if let Some(cap) = re.captures(constraint) {
let v1 = Semver::parse(cap.get(1).context("invalid description")?.as_str())?;
Expand Down
10 changes: 5 additions & 5 deletions lib/src/semver/mod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
pub mod bump;
mod compare;
mod parse;
pub mod compare;
pub mod parse;

#[derive(Default, Debug, Clone, Eq)]
pub struct Semver {
pub components: Vec<usize>,

pub major: usize,
pub minor: usize,
patch: usize,
pub patch: usize,

prerelease: Vec<String>,
build: Vec<String>,
pub prerelease: Vec<String>,
pub build: Vec<String>,

pub raw: String,
}
Expand Down

0 comments on commit c934210

Please sign in to comment.