advotracker: restructure project using crate tree
* advotracker: the framework crate * crate/advotrackerdb: crate implementing the database backend * crate/advotrackerd: the backend daemon * crate/adovtracker: the application (CLI and GUI) Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
43
crates/advotrackerd/src/lib.rs
Normal file
43
crates/advotrackerd/src/lib.rs
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* advotracker - Hotline tackingtool for Advocats
|
||||
*
|
||||
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
|
||||
* SPDX-License-Identifier: 0BSD, MIT
|
||||
*/
|
||||
|
||||
#![warn(missing_docs, rust_2018_idioms, rust_2018_compatibility)]
|
||||
|
||||
//! advotrackerd: crate documentation
|
||||
|
||||
// This function adds two integers (given as arguments) and returns the sum.
|
||||
//
|
||||
// # Examples
|
||||
//
|
||||
// ```
|
||||
// assert_eq!(8, advotrackerd::internal_adder(4, 4));
|
||||
// ```
|
||||
fn internal_adder(a: i32, b: i32) -> i32 {
|
||||
a + b
|
||||
}
|
||||
|
||||
/// This function adds two to its argument.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// assert_eq!(4, advotrackerd::add_two(2));
|
||||
/// ```
|
||||
pub fn add_two(a: i32) -> i32 {
|
||||
internal_adder(a, 2)
|
||||
}
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn internal_test() {
|
||||
assert_eq!(8, internal_adder(4, 4));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user