doc: Add docs to zebra-utils

And `deny(missing_docs)`.
This commit is contained in:
teor 2020-07-28 11:34:16 +10:00 committed by Deirdre Connolly
parent cf0fd043d4
commit cf4840c74a
3 changed files with 25 additions and 7 deletions

View File

@ -1,5 +1,13 @@
//! zebra-checkpoints arguments
//!
//! For usage please refer to the program help: `zebra-checkpoints --help`
#![deny(missing_docs)]
#![allow(clippy::try_err)]
use structopt::StructOpt;
/// zebra-checkpoints arguments
#[derive(Debug, StructOpt)]
pub struct Args {
/// Path to zcash-cli command

View File

@ -8,7 +8,9 @@
//! zebra-consensus accepts an ordered list of checkpoints, starting with the
//! genesis block. Checkpoint heights can be chosen arbitrarily.
#![deny(missing_docs)]
#![allow(clippy::try_err)]
use color_eyre::eyre::Result;
use serde_json::Value;
use std::process::Stdio;
@ -30,7 +32,14 @@ const MAX_CHECKPOINT_BYTE_COUNT: u64 = 256 * 1024 * 1024;
/// zcashd reorg limit.
const BLOCK_REORG_LIMIT: BlockHeight = BlockHeight(100);
// Passthrough arguments if needed
/// Initialise tracing using its defaults.
fn init_tracing() {
tracing_subscriber::Registry::default()
.with(tracing_error::ErrorLayer::default())
.init();
}
/// Add passthrough arguments to `cmd`, if present in `args`.
fn passthrough(mut cmd: std::process::Command, args: &args::Args) -> std::process::Command {
if !args.zcli_args.is_empty() {
cmd.args(&args.zcli_args);
@ -119,9 +128,3 @@ fn main() -> Result<()> {
Ok(())
}
fn init_tracing() {
tracing_subscriber::Registry::default()
.with(tracing_error::ErrorLayer::default())
.init();
}

View File

@ -1,3 +1,10 @@
//! A Zebra utilities crate.
// TODO: split this crate up into crates with meaningful names.
#![deny(missing_docs)]
#![allow(clippy::try_err)]
#[cfg(test)]
mod tests {
#[test]