Skip to content

Commit

Permalink
Small fixes to codecov and rustdoc (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr authored Oct 21, 2022
1 parent e06dc75 commit 70e45d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl PrettyConfig {
/// (indentation level) 6, everything will be put into the same line,
/// without pretty formatting.
///
/// Default: [std::usize::MAX]
/// Default: [usize::MAX]
pub fn depth_limit(mut self, depth_limit: usize) -> Self {
self.depth_limit = depth_limit;

Expand Down Expand Up @@ -177,13 +177,18 @@ impl PrettyConfig {
/// or a multi line one (`false`).
///
/// When `false`, `["a","b"]` (as well as any array) will serialize to
/// `
/// ```
/// [
/// "a",
/// "b",
/// ]
/// `
/// When `true`, `["a","b"]` (as well as any array) will serialize to `["a","b"]`
/// # ;
/// ```
/// When `true`, `["a","b"]` (as well as any array) will serialize to
/// ```
/// ["a","b"]
/// # ;
/// ```
///
/// Default: `false`
pub fn compact_arrays(mut self, compact_arrays: bool) -> Self {
Expand All @@ -194,7 +199,7 @@ impl PrettyConfig {

/// Configures extensions
///
/// Default: Extensions::empty()
/// Default: [Extensions::empty()]
pub fn extensions(mut self, extensions: Extensions) -> Self {
self.extensions = extensions;

Expand All @@ -204,15 +209,17 @@ impl PrettyConfig {
/// Configures whether strings should be serialized using escapes (true)
/// or fall back to raw strings if the string contains a `"` (false).
///
/// When `true`, "a\nb" will serialize to
/// `
/// When `true`, `"a\nb"` will serialize to
/// ```
/// "a\nb"
/// `
/// When `false`, "a\nb" will instead serialize to
/// `
/// # ;
/// ```
/// When `false`, `"a\nb"` will instead serialize to
/// ```
/// "a
/// b"
/// `
/// # ;
/// ```
///
/// Default: `true`
pub fn escape_strings(mut self, escape_strings: bool) -> Self {
Expand All @@ -225,7 +232,7 @@ impl PrettyConfig {
impl Default for PrettyConfig {
fn default() -> Self {
PrettyConfig {
depth_limit: !0,
depth_limit: usize::MAX,
new_line: if cfg!(not(target_os = "windows")) {
String::from("\n")
} else {
Expand Down
2 changes: 2 additions & 0 deletions tests/423_de_borrowed_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ struct SerializeDynVisitor;
impl<'de> Visitor<'de> for SerializeDynVisitor {
type Value = Box<dyn Any>;

// GRCOV_EXCL_START
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(formatter, "a serialize dyn struct")
}
// GRCOV_EXCL_STOP

fn visit_map<A: MapAccess<'de>>(self, mut map: A) -> Result<Self::Value, A::Error> {
let entry = map.next_entry::<&str, String>()?;
Expand Down

0 comments on commit 70e45d6

Please sign in to comment.