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:
12
src/lib.rs
12
src/lib.rs
@@ -5,19 +5,17 @@
|
|||||||
* 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
|
||||||
}
|
}
|
||||||
@@ -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::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user