Skip to content

Commit b63ad14

Browse files
committed
Address needless_doctest_main lint
1 parent 08b0cde commit b63ad14

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

src/de.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,9 +1381,7 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer<R> {
13811381
/// Ok(())
13821382
/// }
13831383
/// #
1384-
/// # fn main() {
1385-
/// # look_at_bytes().unwrap();
1386-
/// # }
1384+
/// # look_at_bytes().unwrap();
13871385
/// ```
13881386
///
13891387
/// Backslash escape sequences like `\n` are still interpreted and required
@@ -1403,9 +1401,7 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer<R> {
14031401
/// assert_eq!(expected_msg, parsed.unwrap_err().to_string());
14041402
/// }
14051403
/// #
1406-
/// # fn main() {
1407-
/// # look_at_bytes();
1408-
/// # }
1404+
/// # look_at_bytes();
14091405
/// ```
14101406
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value>
14111407
where

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@
296296
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
297297
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
298298
// Ignored clippy lints
299-
#![cfg_attr(feature = "cargo-clippy", allow(deprecated_cfg_attr, doc_markdown))]
299+
#![cfg_attr(
300+
feature = "cargo-clippy",
301+
allow(deprecated_cfg_attr, doc_markdown, needless_doctest_main)
302+
)]
300303
// Ignored clippy_pedantic lints
301304
#![cfg_attr(feature = "cargo-clippy", allow(
302305
// Deserializer::from_str, into_iter

src/value/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@
8282
//! Ok(())
8383
//! }
8484
//! #
85-
//! # fn main() {
86-
//! # untyped_example().unwrap();
87-
//! # }
85+
//! # untyped_example().unwrap();
8886
//! ```
8987
//!
9088
//! [macro]: https://docs.serde.rs/serde_json/macro.json.html
@@ -884,9 +882,7 @@ impl Value {
884882
/// # Ok(())
885883
/// # }
886884
/// #
887-
/// # fn main() {
888-
/// # try_main().unwrap()
889-
/// # }
885+
/// # try_main().unwrap()
890886
/// ```
891887
impl Default for Value {
892888
fn default() -> Value {
@@ -935,9 +931,7 @@ mod ser;
935931
/// Ok(())
936932
/// }
937933
/// #
938-
/// # fn main() {
939-
/// # compare_json_values().unwrap();
940-
/// # }
934+
/// # compare_json_values().unwrap();
941935
/// ```
942936
///
943937
/// # Errors

0 commit comments

Comments
 (0)