From dc3917b05018cb32e2451d9eaed242036c5e7512 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Tue, 28 Jan 2025 21:23:07 -0600 Subject: wip: auth --- src/util.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util.rs') 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 }, -- cgit v1.2.3-70-g09d2