summaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
authorLibravatar bigfoot547 <[email protected]>2025-01-28 21:23:07 -0600
committerLibravatar bigfoot547 <[email protected]>2025-01-28 21:23:07 -0600
commitdc3917b05018cb32e2451d9eaed242036c5e7512 (patch)
treef697a64acf2eb5d7d2419d9ca3b97be05f9067ee /src/util.rs
parentinteractive auth testing (diff)
wip: auth
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.rs b/src/util.rs
index 0685848..8d35fb9 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -2,6 +2,7 @@ use std::error::Error;
use std::fmt::{Display, Formatter};
use std::io::ErrorKind;
use std::path::{Component, Path, PathBuf};
+use const_format::formatcp;
use log::{debug, info, warn};
use sha1_smol::{Digest, Sha1};
use tokio::fs::File;
@@ -9,6 +10,12 @@ use tokio::{fs, io};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use crate::util;
+const PKG_NAME: &str = env!("CARGO_PKG_NAME");
+const PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
+const CRATE_NAME: &str = env!("CARGO_CRATE_NAME");
+
+pub const USER_AGENT: &str = formatcp!("{PKG_NAME}/{PKG_VERSION} (in {CRATE_NAME})");
+
#[derive(Debug)]
pub enum IntegrityError {
SizeMismatch{ expect: usize, actual: usize },