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

Open
dmerejkowsky opened this issue Jul 21, 2022 · 0 comments
Open

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

dmerejkowsky opened this issue Jul 21, 2022 · 0 comments

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
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

1 participant