From d3fc479b68b9b8bdf2106ba0e36e5dc6a36b3c3b Mon Sep 17 00:00:00 2001 From: Pmarquez <48651252+pxp9@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:05:58 +0000 Subject: [PATCH] Docs improvement (#80) * I little bit improve docs * README * disable tests for docs --- Cargo.toml | 3 +++ Makefile | 3 +++ README.md | 16 ++++++++-------- src/lib.rs | 4 +++- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a431709..0ac4be2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,9 @@ rust-version = "1.62" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +doctest = false + [features] default = ["blocking", "asynk"] blocking = ["diesel", "diesel-derive-enum", "dotenv"] diff --git a/Makefile b/Makefile index df544cf..f955856 100644 --- a/Makefile +++ b/Makefile @@ -15,3 +15,6 @@ tests: ignored: DATABASE_URL=postgres://postgres:postgres@localhost/fang cargo test --all-features -- --color always --nocapture --ignored + +doc: + cargo doc --open diff --git a/README.md b/README.md index efbc17f..e8d1870 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -
+ [![Crates.io][s1]][ci] [![docs page][docs-badge]][docs] ![test][ga-test] ![style][ga-style] @@ -288,9 +288,9 @@ There are three retention modes you can use: ```rust pub enum RetentionMode { - KeepAll, \\ doesn't remove tasks - RemoveAll, \\ removes all tasks - RemoveFinished, \\ default value + KeepAll, // doesn't remove tasks + RemoveAll, // removes all tasks + RemoveFinished, // default value } ``` @@ -304,10 +304,10 @@ You can use use `SleepParams` to confugure sleep values: ```rust pub struct SleepParams { - pub sleep_period: Duration, \\ default value is 5 seconds - pub max_sleep_period: Duration, \\ default value is 15 seconds - pub min_sleep_period: Duration, \\ default value is 5 seconds - pub sleep_step: Duration, \\ default value is 5 seconds + pub sleep_period: Duration, // default value is 5 seconds + pub max_sleep_period: Duration, // default value is 15 seconds + pub min_sleep_period: Duration, // default value is 5 seconds + pub sleep_step: Duration, // default value is 5 seconds } ``` diff --git a/src/lib.rs b/src/lib.rs index 47d3f27..17ef76e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![doc = include_str!("../README.md")] #![allow(clippy::extra_unused_lifetimes)] use std::time::Duration; @@ -87,9 +88,10 @@ pub extern crate chrono; #[doc(hidden)] pub use serde_derive::{Deserialize, Serialize}; +#[doc(hidden)] pub use chrono::DateTime; +#[doc(hidden)] pub use chrono::Utc; -pub use cron::Schedule; #[cfg(feature = "blocking")] pub mod blocking;