diff --git a/src/document.rs b/src/document.rs index f2df91d..d95c985 100644 --- a/src/document.rs +++ b/src/document.rs @@ -245,15 +245,15 @@ impl KdlDocument { /// Formats the document according to `config`. pub fn autoformat_config(&mut self, config: &FormatConfig<'_>) { - if let Some(KdlDocumentFormat { leading, .. }) = (&mut *self).format_mut() { + if let Some(KdlDocumentFormat { leading, .. }) = (*self).format_mut() { crate::fmt::autoformat_leading(leading, config); } let mut has_nodes = false; - for node in &mut (&mut *self).nodes { + for node in &mut self.nodes { has_nodes = true; node.autoformat_config(config); } - if let Some(KdlDocumentFormat { trailing, .. }) = (&mut *self).format_mut() { + if let Some(KdlDocumentFormat { trailing, .. }) = (*self).format_mut() { crate::fmt::autoformat_trailing(trailing, config.no_comments); if !has_nodes { trailing.push('\n'); diff --git a/src/fmt.rs b/src/fmt.rs index fbc927c..f2ae259 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -81,7 +81,7 @@ impl<'a> FormatConfigBuilder<'a> { /// The indentation to use at each level. /// Defaults to four spaces if not specified. - pub const fn indent<'b>(self, indent: &'b str) -> FormatConfigBuilder<'b> { + pub const fn indent(self, indent: &str) -> FormatConfigBuilder<'_> { FormatConfigBuilder(FormatConfig { indent, ..self.0 }) } diff --git a/src/lib.rs b/src/lib.rs index 1c3ca5a..b49a041 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ //! //! This crate supports parsing [KDL //! 2.0.0-draft.6](https://github.com/kdl-org/kdl/releases/tag/2.0.0-draft.6) -//! +//! //! ## Example //! //! ```rust