mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
About
This commit is contained in:
parent
7b8490c5f2
commit
79ddb6f626
34
src/about.rs
Normal file
34
src/about.rs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#[derive(Debug)]
|
||||||
|
pub struct About {
|
||||||
|
pub name: String,
|
||||||
|
pub version: String,
|
||||||
|
pub description: String,
|
||||||
|
pub authors: String,
|
||||||
|
pub repository: String,
|
||||||
|
pub homepage: String,
|
||||||
|
pub license: String,
|
||||||
|
pub database_path: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub fn about() -> About {
|
||||||
|
let data_dir = match dirs::data_dir() {
|
||||||
|
Some(mut d) => {
|
||||||
|
d.push("gossip");
|
||||||
|
d.push("gossip.sqlite");
|
||||||
|
format!("{}", d.display())
|
||||||
|
}
|
||||||
|
None => "Cannot find a directory to store application data.".to_owned(),
|
||||||
|
};
|
||||||
|
|
||||||
|
About {
|
||||||
|
name: env!("CARGO_PKG_NAME").to_string(),
|
||||||
|
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||||
|
description: env!("CARGO_PKG_DESCRIPTION").to_string(),
|
||||||
|
authors: env!("CARGO_PKG_AUTHORS").to_string(),
|
||||||
|
repository: env!("CARGO_PKG_REPOSITORY").to_string(),
|
||||||
|
homepage: env!("CARGO_PKG_HOMEPAGE").to_string(),
|
||||||
|
license: env!("CARGO_PKG_LICENSE").to_string(),
|
||||||
|
database_path: data_dir,
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
||||||
|
mod about;
|
||||||
mod comms;
|
mod comms;
|
||||||
mod db;
|
mod db;
|
||||||
mod error;
|
mod error;
|
||||||
|
Loading…
Reference in New Issue
Block a user