From 366fd3d10a5ba48dfca6c66aabac267c370ef579 Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Sun, 16 May 2021 15:30:26 +0200 Subject: [PATCH] Remove `example` module and `doc-example` feature Now that we use derives, not a lot of magic happens anymore. Thus, I think it's not necessary to show the generated stuff anymore. --- Cargo.toml | 5 ----- src/example.rs | 43 ------------------------------------------- 2 files changed, 48 deletions(-) delete mode 100644 src/example.rs diff --git a/Cargo.toml b/Cargo.toml index afa78d8..34c7429 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,13 +9,8 @@ edition = "2018" default = ["toml", "yaml"] yaml = ["serde_yaml"] -# This is used to enable the `example` module. This is only useful to generate -# the docs for this library! -doc-example = ["log"] - [dependencies] confique-macro = { path = "macro" } -log = { version = "0.4", features = ["serde"], optional = true } serde = { version = "1", features = ["derive"] } serde_yaml = { version = "0.8", optional = true } toml = { version = "0.5", optional = true } diff --git a/src/example.rs b/src/example.rs deleted file mode 100644 index a348658..0000000 --- a/src/example.rs +++ /dev/null @@ -1,43 +0,0 @@ -//! This module demonstrate what a `config!` invocation will generate. This -//! module exists merely for documentation purposes and is not usable from your -//! crate. -//! -//! TODO - -use std::{net::IpAddr, path::PathBuf}; - -// This is necessary because the macro generates a bunch of paths starting with -// `confique`, assuming that symbol is in scope. -#[doc(hidden)] -use crate as confique; - -crate::config! { - // This is used here to make all items show up in the documentation. - #![visibility = "pub"] - - /// An example configuration. - config: { - dns: { - /// The DNS server IP address. - #[example = "1.1.1.1"] - server: IpAddr, - - /// Whether to use a local DNS resolution cache. - use_cache: bool = true, - - /// How often to reattempt reaching the DNS server. - retry_attempts: u32 = 27, - }, - - #[typename = "Logger"] - log: { - /// Sets the log level. Possible values: "trace", "debug", "info", - /// "warn", "error" and "off". - level: log::LevelFilter = "info", - - /// If this is set, log messages are also written to this file. - #[example = "/var/log/test.log"] - file: Option, - }, - } -}