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

ambee/giterated

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

Refactor handshake messages

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨6c50283

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