Skip to content

Commit

Permalink
Address needless_doctest_main lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 9, 2019
1 parent 08b0cde commit b63ad14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
8 changes: 2 additions & 6 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,7 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer<R> {
/// Ok(())
/// }
/// #
/// # fn main() {
/// # look_at_bytes().unwrap();
/// # }
/// # look_at_bytes().unwrap();
/// ```
///
/// Backslash escape sequences like `\n` are still interpreted and required
Expand All @@ -1403,9 +1401,7 @@ impl<'de, 'a, R: Read<'de>> de::Deserializer<'de> for &'a mut Deserializer<R> {
/// assert_eq!(expected_msg, parsed.unwrap_err().to_string());
/// }
/// #
/// # fn main() {
/// # look_at_bytes();
/// # }
/// # look_at_bytes();
/// ```
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value>
where
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
// Ignored clippy lints
#![cfg_attr(feature = "cargo-clippy", allow(deprecated_cfg_attr, doc_markdown))]
#![cfg_attr(
feature = "cargo-clippy",
allow(deprecated_cfg_attr, doc_markdown, needless_doctest_main)
)]
// Ignored clippy_pedantic lints
#![cfg_attr(feature = "cargo-clippy", allow(
// Deserializer::from_str, into_iter
Expand Down
12 changes: 3 additions & 9 deletions src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@
//! Ok(())
//! }
//! #
//! # fn main() {
//! # untyped_example().unwrap();
//! # }
//! # untyped_example().unwrap();
//! ```
//!
//! [macro]: https://docs.serde.rs/serde_json/macro.json.html
Expand Down Expand Up @@ -884,9 +882,7 @@ impl Value {
/// # Ok(())
/// # }
/// #
/// # fn main() {
/// # try_main().unwrap()
/// # }
/// # try_main().unwrap()
/// ```
impl Default for Value {
fn default() -> Value {
Expand Down Expand Up @@ -935,9 +931,7 @@ mod ser;
/// Ok(())
/// }
/// #
/// # fn main() {
/// # compare_json_values().unwrap();
/// # }
/// # compare_json_values().unwrap();
/// ```
///
/// # Errors
Expand Down

0 comments on commit b63ad14

Please sign in to comment.