Skip to content

Commit

Permalink
clippy fix and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Dec 9, 2024
1 parent 014c7c5 commit cbadb35
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbadb35

Please sign in to comment.