diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..5db3158 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-Clink-arg=-fuse-ld=mold", "-Ctarget-cpu=native"] diff --git a/.gitignore b/.gitignore index 3ca43ae..193d30e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,8 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb + + +# Added by cargo + +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..bdb547b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "idlefox" +version = "0.1.0" +edition = "2021" + +[dependencies] + +[profile.dev] +debug = 0 + +[profile.release] +strip = true +lto = true +codegen-units = 1 +panic = "abort" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] } diff --git a/src/io.rs b/src/io.rs new file mode 100644 index 0000000..96e2a77 --- /dev/null +++ b/src/io.rs @@ -0,0 +1,10 @@ +//! All IO related functions, include all Discord IO functions +//! +//! Features: +//! All recv and send functions to discord +//! Helper function for advanced checks + +#[cfg(test)] +mod tests { + // use super::*; +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..bfd1c1d --- /dev/null +++ b/src/main.rs @@ -0,0 +1,18 @@ +//! A Rust Discord Bot, in charge of greatly simplifying the process of finding a meeting date, organising an event and choosing between several options. +//! +//! + +// This line is here to force the use of extensive documentation +#![warn(clippy::missing_docs_in_private_items)] + +mod io; +mod modules; +mod persistence; +mod server; +mod votes; +mod watchdog; + +#[cfg(not(tarpaulin_include))] +fn main() { + println!("Hello, world!"); +} diff --git a/src/modules.rs b/src/modules.rs new file mode 100644 index 0000000..2e936d2 --- /dev/null +++ b/src/modules.rs @@ -0,0 +1,11 @@ +//! Modules handling all logic of votes, vote evolution and vote triggering, all IO links to here +//! This module republishes many outside modules +//! +//! Features: +//! Many handler functions +//! Every module encompassing a feature + +#[cfg(test)] +mod tests { + // use super::*; +} diff --git a/src/persistence.rs b/src/persistence.rs new file mode 100644 index 0000000..9604417 --- /dev/null +++ b/src/persistence.rs @@ -0,0 +1,12 @@ +//! Data persistence between runs, prevents data loss in the event of a crash +//! +//! Features: +//! Data persistence +//! Data integrity check (remote and local) +//! +//! + +#[cfg(test)] +mod tests { + // use super::*; +} diff --git a/src/server.rs b/src/server.rs new file mode 100644 index 0000000..c037574 --- /dev/null +++ b/src/server.rs @@ -0,0 +1,11 @@ +//! All server related features +//! +//! Features: +//! Show all votes (pending and happening) +//! Allow vote closing +//! + +#[cfg(test)] +mod tests { + // use super::*; +} diff --git a/src/votes.rs b/src/votes.rs new file mode 100644 index 0000000..25e5c98 --- /dev/null +++ b/src/votes.rs @@ -0,0 +1,14 @@ +//! Handles all votes related logic +//! +//! Features: +//! Structs & Traits +//! Votes (struct) +//! Event (struct) +//! ListCurrentEvents (struct) +//! ListFutureEvents (struct) +//! + +#[cfg(test)] +mod tests { + // use super::*; +} diff --git a/src/watchdog.rs b/src/watchdog.rs new file mode 100644 index 0000000..db45f1c --- /dev/null +++ b/src/watchdog.rs @@ -0,0 +1,12 @@ +//! Event scheduler in charge of waiting out events and enabling them when times comes +//! +//! Features: +//! Time based garbage collector +//! Time managed events +//! +//! + +#[cfg(test)] +mod tests { + // use super::*; +}