Enable `ref_option` lint and allow individually
Enable the lint and allow the ref_option lint in the cases where the lint wants us to change the API to use `Option<&T>` instead of `&Option<T>`
This commit is contained in:
parent
b4cb7f961f
commit
29f1a4613a
|
@ -129,7 +129,7 @@ redundant_closure_for_method_calls = "warn"
|
|||
redundant_else = "warn"
|
||||
ref_as_ptr = "warn"
|
||||
ref_binding_to_reference = "warn"
|
||||
ref_option = "allow" # TODO: Still neds considering.
|
||||
ref_option = "warn"
|
||||
ref_option_ref = "warn"
|
||||
return_self_not_must_use = "warn"
|
||||
same_functions_in_if_condition = "warn"
|
||||
|
|
|
@ -207,6 +207,7 @@ pub mod as_sat {
|
|||
use super::private;
|
||||
use crate::amount::serde::SerdeAmountForOpt;
|
||||
|
||||
#[allow(clippy::ref_option)] // API forced by serde.
|
||||
pub fn serialize<A: SerdeAmountForOpt, S: Serializer>(
|
||||
a: &Option<A>,
|
||||
s: S,
|
||||
|
@ -277,6 +278,7 @@ pub mod as_btc {
|
|||
use super::private;
|
||||
use crate::amount::serde::SerdeAmountForOpt;
|
||||
|
||||
#[allow(clippy::ref_option)] // API forced by serde.
|
||||
pub fn serialize<A: SerdeAmountForOpt, S: Serializer>(
|
||||
a: &Option<A>,
|
||||
s: S,
|
||||
|
@ -347,6 +349,7 @@ pub mod as_str {
|
|||
use super::private;
|
||||
use crate::amount::serde::SerdeAmountForOpt;
|
||||
|
||||
#[allow(clippy::ref_option)] // API forced by serde.
|
||||
pub fn serialize<A: SerdeAmountForOpt, S: Serializer>(
|
||||
a: &Option<A>,
|
||||
s: S,
|
||||
|
|
|
@ -53,6 +53,7 @@ pub mod as_sat_per_kwu {
|
|||
|
||||
use crate::FeeRate;
|
||||
|
||||
#[allow(clippy::ref_option)] // API forced by serde.
|
||||
pub fn serialize<S: Serializer>(f: &Option<FeeRate>, s: S) -> Result<S::Ok, S::Error> {
|
||||
match *f {
|
||||
Some(f) => s.serialize_some(&f.to_sat_per_kwu()),
|
||||
|
@ -124,6 +125,7 @@ pub mod as_sat_per_vb_floor {
|
|||
use crate::fee_rate::serde::OverflowError;
|
||||
use crate::fee_rate::FeeRate;
|
||||
|
||||
#[allow(clippy::ref_option)] // API forced by serde.
|
||||
pub fn serialize<S: Serializer>(f: &Option<FeeRate>, s: S) -> Result<S::Ok, S::Error> {
|
||||
match *f {
|
||||
Some(f) => s.serialize_some(&f.to_sat_per_vb_floor()),
|
||||
|
@ -199,6 +201,7 @@ pub mod as_sat_per_vb_ceil {
|
|||
use crate::fee_rate::serde::OverflowError;
|
||||
use crate::fee_rate::FeeRate;
|
||||
|
||||
#[allow(clippy::ref_option)] // API forced by serde.
|
||||
pub fn serialize<S: Serializer>(f: &Option<FeeRate>, s: S) -> Result<S::Ok, S::Error> {
|
||||
match *f {
|
||||
Some(f) => s.serialize_some(&f.to_sat_per_vb_ceil()),
|
||||
|
|
Loading…
Reference in New Issue