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

ambee/giterated

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

Completely refactor project structure

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨ae8ff44

⁨giterated-daemon/src/lib.rs⁩ - ⁨414⁩ 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 message;
9
10 #[macro_use]
11 extern crate tracing;
12
13 pub fn version() -> Version {
14 Version::from_str(env!("CARGO_PKG_VERSION")).unwrap()
15 }
16
17 pub fn validate_version(other: &Version) -> bool {
18 let version_req = VersionReq::from_str("=0.0.6").unwrap();
19
20 version_req.matches(other)
21 }
22