From 8a1dd9a9e1d8efbc3e1d13fd8c57189551fbebe0 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 24 Jan 2022 18:49:07 +1100 Subject: [PATCH] Configure global lints in .cargo/config In the absence of a way to configure lints across a workspace, we use a technique described in https://github.com/EmbarkStudios/rust-ecosystem/pull/68. This allows us to move the lints that should unconditionally apply to all crates to this one config, unblocking the split up of the mega crate into multiple smaller ones. --- .cargo/config.toml | 8 ++++++++ daemon/src/lib.rs | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 0792ceb664..db49e8c15e 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,3 +4,11 @@ linker = "aarch64-linux-gnu-gcc" [alias] dev-maker = "run --bin maker -- testnet" dev-taker = "run --bin taker -- --maker localhost:9999 --maker-id 10d4ba2ac3f7a22da4009d813ff1bc3f404dfe2cc93a32bedf1512aa9951c95e testnet" # Maker ID matches seed found in `testnet/maker_seed` + +# Inspired by https://github.com/EmbarkStudios/rust-ecosystem/pull/68. +[build] +rustflags = [ + "-Wclippy::disallowed_method", + "-Wclippy::dbg_macro", + "-Wunused-import-braces", +] diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index 62f7340349..904f7fb5af 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -1,6 +1,5 @@ #![cfg_attr(not(test), warn(clippy::unwrap_used))] -#![warn(clippy::disallowed_method)] -#![warn(clippy::dbg_macro)] // should be used only as a temporary debugging tool + use crate::bitcoin::Txid; use crate::bitmex_price_feed::QUOTE_INTERVAL_MINUTES; use crate::model::cfd::Order;