lib.rs: warnings missing docs, 2018 compliance

- enable project wide compiler warnings
- update documentation strings

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-06-12 22:32:03 +02:00
parent 7816e2c804
commit 45ee22c473

View File

@@ -5,21 +5,19 @@
* SPDX-License-Identifier: 0BSD, MIT
*/
//#[macro_use]
//extern crate diesel;
#![warn(missing_docs, rust_2018_idioms, rust_2018_compatibility)]
//pub mod db;
//! advotrackerd: crate documentation
// This function adds two integers (given as arguments) and returns the sum.
//
// # Examples
//
// ```
// assert_eq!(8, advotracker_backend::internal_adder(4, 4));
// assert_eq!(8, advotrackerd::internal_adder(4, 4));
// ```
fn internal_adder(a: i32, b: i32) -> i32 {
a + b
a + b
}
/// This function adds two to its argument.
@@ -27,13 +25,13 @@ fn internal_adder(a: i32, b: i32) -> i32 {
/// # Examples
///
/// ```
/// assert_eq!(4, advotracker_backend::add_two(2));
/// assert_eq!(4, advotrackerd::add_two(2));
/// ```
pub fn add_two(a: i32) -> i32 {
internal_adder(a, 2)
}
#[cfg(test)]
mod tests {
use super::*;