diff options
Diffstat (limited to 'src/util.rs')
| -rw-r--r-- | src/util.rs | 7 |
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 }, |
