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

Cannot easily format nodes if std::fmt::Display is in scope #48

Closed
dmerejkowsky opened this issue Jul 21, 2022 · 1 comment
Closed

Cannot easily format nodes if std::fmt::Display is in scope #48

dmerejkowsky opened this issue Jul 21, 2022 · 1 comment

Comments

@dmerejkowsky
Copy link
Contributor

dmerejkowsky commented Jul 21, 2022

Steps to reproduce:

use kdl::{KdlIdentifier, KdlNode};
use std::fmt::Display;   // <----- here!

fn main() {
    let mut section_node = KdlNode::new(KdlIdentifier::from("words"));
    section_node.fmt();
}

Error message:

error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> crates/core/src/config.rs:266:22
    |
266 |         section_node.fmt();
    |                      ^^^- supplied 0 arguments
    |                      |
    |                      expected 1 argument
    |
note: associated function defined here
   --> /home/dimitri/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/mod.rs:772:8
    |
772 |     fn fmt(&self, f: &mut Formatter<'_>) -> Result;
    |        ^^^

I think it would be best to rename fmt to auto_format or something like this

@dmerejkowsky dmerejkowsky mentioned this issue Jul 21, 2022
@zkat
Copy link
Member

zkat commented Oct 7, 2024

this is fixed because the method is now called "autoformat"

@zkat zkat closed this as completed Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants