Deny unused imports and remove unneeded
This commit is contained in:
parent
df1a5fd6b5
commit
52ff97cddc
|
@ -696,7 +696,7 @@ impl<'de> serde::Deserialize<'de> for Script {
|
||||||
where
|
where
|
||||||
D: serde::Deserializer<'de>,
|
D: serde::Deserializer<'de>,
|
||||||
{
|
{
|
||||||
use std::fmt::{self, Formatter};
|
use std::fmt::Formatter;
|
||||||
|
|
||||||
struct Visitor;
|
struct Visitor;
|
||||||
impl<'de> serde::de::Visitor<'de> for Visitor {
|
impl<'de> serde::de::Visitor<'de> for Visitor {
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
#![deny(non_camel_case_types)]
|
#![deny(non_camel_case_types)]
|
||||||
#![deny(non_snake_case)]
|
#![deny(non_snake_case)]
|
||||||
#![deny(unused_mut)]
|
#![deny(unused_mut)]
|
||||||
|
#![deny(dead_code)]
|
||||||
|
#![deny(unused_imports)]
|
||||||
#![deny(missing_docs)]
|
#![deny(missing_docs)]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
|
|
||||||
|
|
|
@ -956,7 +956,7 @@ pub mod serde {
|
||||||
//! Serialize and deserialize [Amount] as real numbers denominated in satoshi.
|
//! Serialize and deserialize [Amount] as real numbers denominated in satoshi.
|
||||||
//! Use with `#[serde(with = "amount::serde::as_sat")]`.
|
//! Use with `#[serde(with = "amount::serde::as_sat")]`.
|
||||||
|
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserializer, Serializer};
|
||||||
use util::amount::serde::SerdeAmount;
|
use util::amount::serde::SerdeAmount;
|
||||||
|
|
||||||
pub fn serialize<A: SerdeAmount, S: Serializer>(a: &A, s: S) -> Result<S::Ok, S::Error> {
|
pub fn serialize<A: SerdeAmount, S: Serializer>(a: &A, s: S) -> Result<S::Ok, S::Error> {
|
||||||
|
@ -971,7 +971,7 @@ pub mod serde {
|
||||||
//! Serialize and deserialize [Optoin<Amount>] as real numbers denominated in satoshi.
|
//! Serialize and deserialize [Optoin<Amount>] as real numbers denominated in satoshi.
|
||||||
//! Use with `#[serde(default, with = "amount::serde::as_sat::opt")]`.
|
//! Use with `#[serde(default, with = "amount::serde::as_sat::opt")]`.
|
||||||
|
|
||||||
use serde::{Deserialize, Deserializer, Serializer};
|
use serde::{Deserializer, Serializer};
|
||||||
use util::amount::serde::SerdeAmount;
|
use util::amount::serde::SerdeAmount;
|
||||||
|
|
||||||
pub fn serialize<A: SerdeAmount, S: Serializer>(
|
pub fn serialize<A: SerdeAmount, S: Serializer>(
|
||||||
|
@ -996,7 +996,7 @@ pub mod serde {
|
||||||
//! Serialize and deserialize [Amount] as JSON numbers denominated in BTC.
|
//! Serialize and deserialize [Amount] as JSON numbers denominated in BTC.
|
||||||
//! Use with `#[serde(with = "amount::serde::as_btc")]`.
|
//! Use with `#[serde(with = "amount::serde::as_btc")]`.
|
||||||
|
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserializer, Serializer};
|
||||||
use util::amount::serde::SerdeAmount;
|
use util::amount::serde::SerdeAmount;
|
||||||
|
|
||||||
pub fn serialize<A: SerdeAmount, S: Serializer>(a: &A, s: S) -> Result<S::Ok, S::Error> {
|
pub fn serialize<A: SerdeAmount, S: Serializer>(a: &A, s: S) -> Result<S::Ok, S::Error> {
|
||||||
|
@ -1011,7 +1011,7 @@ pub mod serde {
|
||||||
//! Serialize and deserialize [Option<Amount>] as JSON numbers denominated in BTC.
|
//! Serialize and deserialize [Option<Amount>] as JSON numbers denominated in BTC.
|
||||||
//! Use with `#[serde(default, with = "amount::serde::as_btc::opt")]`.
|
//! Use with `#[serde(default, with = "amount::serde::as_btc::opt")]`.
|
||||||
|
|
||||||
use serde::{Deserialize, Deserializer, Serializer};
|
use serde::{Deserializer, Serializer};
|
||||||
use util::amount::serde::SerdeAmount;
|
use util::amount::serde::SerdeAmount;
|
||||||
|
|
||||||
pub fn serialize<A: SerdeAmount, S: Serializer>(
|
pub fn serialize<A: SerdeAmount, S: Serializer>(
|
||||||
|
@ -1247,7 +1247,6 @@ mod tests {
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
#[test]
|
#[test]
|
||||||
fn serde_as_sat() {
|
fn serde_as_sat() {
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
||||||
struct T {
|
struct T {
|
||||||
|
@ -1279,7 +1278,6 @@ mod tests {
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
#[test]
|
#[test]
|
||||||
fn serde_as_btc() {
|
fn serde_as_btc() {
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
||||||
|
@ -1314,7 +1312,6 @@ mod tests {
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
#[test]
|
#[test]
|
||||||
fn serde_as_btc_opt() {
|
fn serde_as_btc_opt() {
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
#[derive(Serialize, Deserialize, PartialEq, Debug)]
|
||||||
|
|
Loading…
Reference in New Issue