Files
advotracker/crates/advotrackerd/src/lib.rs
Ralf Zerres 4c88167bef 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>
2021-03-08 04:32:11 +01:00

44 lines
797 B
Rust

/*
* 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));
}
}