diff --git a/metrics/examples/basic.rs b/metrics/examples/basic.rs index a8c29f7..3ac627a 100644 --- a/metrics/examples/basic.rs +++ b/metrics/examples/basic.rs @@ -10,9 +10,6 @@ use metrics::{ Key, Recorder, Unit, }; -#[allow(dead_code)] -static RECORDER: PrintRecorder = PrintRecorder; - #[derive(Default)] struct PrintRecorder; @@ -51,17 +48,11 @@ impl Recorder for PrintRecorder { } } -#[cfg(feature = "std")] fn init_print_logger() { let recorder = PrintRecorder::default(); metrics::set_boxed_recorder(Box::new(recorder)).unwrap() } -#[cfg(not(feature = "std"))] -fn init_print_logger() { - metrics::set_recorder(&RECORDER).unwrap() -} - fn main() { let server_name = "web03".to_string(); diff --git a/netlify.toml b/netlify.toml index d200074..201dc0e 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,4 +1,11 @@ +[build] + command = """ + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --profile minimal \ + && source $HOME/.cargo/env \ + && RUSTDOCFLAGS=\"--cfg docsrs\" cargo +nightly doc --no-deps + """ + publish = "target/doc" + [[redirects]] from = "/" - to = "https://docs.rs/metrics" - status = 302 + to = "/metrics" \ No newline at end of file