Skip to content

Commit 2651ea1

Browse files
bors[bot]jonasbb
andauthored
Merge #223
223: Fix clippy lints on nightly r=jonasbb a=jonasbb Co-authored-by: Jonas Bushart <jonas@bushart.org>
2 parents 892f96b + 5fe25d7 commit 2651ea1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

serde_with_macros/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
// Not needed for 2018 edition and conflicts with `rust_2018_idioms`
2525
#![doc(test(no_crate_inject))]
2626
#![doc(html_root_url = "https://docs.rs/serde_with_macros/1.3.0")]
27+
// Necessary for nightly clippy lints
28+
#![allow(clippy::unknown_clippy_lints)]
2729

2830
//! proc-macro extensions for [`serde_with`]
2931
//!
@@ -577,6 +579,10 @@ fn serde_as_add_attr_to_field(
577579
}
578580

579581
/// Parse a [`String`] and return a [`syn::Type`]
582+
583+
// Return type is required by the darling struct fields
584+
// It needs to be an Option, such that is represents an optional field
585+
#[allow(clippy::unnecessary_wraps)]
580586
fn parse_type_from_string(s: String) -> Option<Result<Type, Error>> {
581587
Some(syn::parse_str(&*s))
582588
}

0 commit comments

Comments
 (0)