Skip to content

Commit

Permalink
Small fixes to codecov and rustdoc (ron-rs#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Aug 15, 2023
1 parent 368a861 commit 04601bb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,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 @@ -169,15 +169,22 @@ impl PrettyConfig {
self
}

/// Configures whether every array should be a single line (true) or a multi line one (false)
/// When false, `["a","b"]` (as well as any array) will serialize to
/// `
/// Configures whether every array should be a single line (`true`)
/// 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 @@ -188,7 +195,7 @@ impl PrettyConfig {

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

Expand All @@ -199,7 +206,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 04601bb

Please sign in to comment.