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.
This commit is contained in:
Lukas Kalbertodt
2021-05-16 15:30:26 +02:00
parent 32fbfd3a5a
commit 366fd3d10a
2 changed files with 0 additions and 48 deletions

View File

@@ -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 }

View File

@@ -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<PathBuf>,
},
}
}