JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Major post-refactor cleanup

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨f90d7fb

⁨src/lib.rs⁩ - ⁨449⁩ bytes
Raw
1 use std::str::FromStr;
2
3 use semver::{Version, VersionReq};
4
5 pub mod authentication;
6 pub mod backend;
7 pub mod connection;
8 pub mod handshake;
9 pub mod messages;
10 pub mod model;
11
12 #[macro_use]
13 extern crate tracing;
14
15 pub fn version() -> Version {
16 Version::from_str(env!("CARGO_PKG_VERSION")).unwrap()
17 }
18
19 pub fn validate_version(other: &Version) -> bool {
20 let version_req = VersionReq::from_str("=0.0.6").unwrap();
21
22 version_req.matches(other)
23 }
24