Skip to content

Commit d58fab4

Browse files
authored
Merge pull request #4 from cgwalters/add-docs
Add more docs
2 parents e0667e9 + ad8709f commit d58fab4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#![doc = include_str!("../README.md")]
55
#![forbid(unsafe_code)]
6+
#![deny(missing_docs)]
67

78
mod floatformat;
89

@@ -12,7 +13,7 @@ use std::io::{Error, ErrorKind, Result, Write};
1213
use serde::Serialize;
1314
use serde_json::ser::{CharEscape, CompactFormatter, Formatter, Serializer};
1415

15-
/// A [`Formatter`] that produces canonical JSON.
16+
/// A [`Formatter`] that produces canonical (RFC 8785) JSON.
1617
///
1718
/// See the [crate-level documentation](../index.html) for more detail.
1819
///
@@ -351,11 +352,15 @@ impl Formatter for CanonicalFormatter {
351352
}
352353
}
353354

355+
/// A helper trait to write canonical JSON.
354356
pub trait CanonJsonSerialize {
357+
/// Serialize the given data structure as JSON into the I/O stream.
355358
fn to_canon_json_writer<W>(&self, writer: W) -> Result<()>
356359
where
357360
W: Write;
361+
/// Serialize the given data structure as a JSON byte vector.
358362
fn to_canon_json_vec(&self) -> Result<Vec<u8>>;
363+
/// Serialize the given data structure as a String.
359364
fn to_canon_json_string(&self) -> Result<String>;
360365
}
361366

0 commit comments

Comments
 (0)