Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes to codecov and rustdoc #427

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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