Skip to content

Commit

Permalink
Small Cleanup of message lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
haixuanTao committed Oct 8, 2024
1 parent 934c84c commit 1b33392
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions libraries/message/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
#![allow(clippy::missing_safety_doc)]

use std::fmt::format;

use eyre::Context;

pub mod common;
pub mod metadata;

Expand All @@ -25,16 +21,14 @@ pub type DataflowId = uuid::Uuid;

fn current_crate_version() -> semver::Version {
let crate_version_raw = env!("CARGO_PKG_VERSION");
let crate_version = semver::Version::parse(crate_version_raw).unwrap();
crate_version
semver::Version::parse(crate_version_raw).unwrap()
}

fn versions_compatible(
crate_version: &semver::Version,
specified_version: &semver::Version,
) -> Result<bool, String> {
let current_version = semver::Version::parse(env!("CARGO_PKG_VERSION"))
.map_err(|error| format!("failed to parse current version: {error}"))?;
let current_version = current_crate_version();
let req = semver::VersionReq::parse(&format!(
"~{}.{}.0",
current_version.major, current_version.minor
Expand Down

0 comments on commit 1b33392

Please sign in to comment.