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