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

Derive Debug for public structs #59

Merged
merged 3 commits into from
Jul 31, 2017
Merged

Conversation

tmccombs
Copy link
Contributor

Fixes #34

Copy link
Contributor

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tmccombs! I've just left a simple comment about the WalkDirOptions Debug implementation.

src/lib.rs Outdated
@@ -195,6 +196,20 @@ struct WalkDirOptions {
contents_first: bool,
}

impl fmt::Debug for WalkDirOptions {
fn fmt(&self, f: &mut fmt::Formatter) -> ::std::result::Result<(), fmt::Error> {
write!(f, "WalkDirOptions {{ follow_links: {:?}, max_open: {:?}, \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to manually implement Debug for the sort_by field?

There's a handy debug_struct method on Formatter that we could use here to simplify this implementation.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should definitely be using debug_struct.

@KodrAus
Copy link
Contributor

KodrAus commented Jun 26, 2017

Hmm, it looks like we might have to do some more Debug implementations manually to keep the code compiling on Rust 1.10.

@KodrAus
Copy link
Contributor

KodrAus commented Jun 26, 2017

Looks like we'll bump the minimum version to 1.16 in #52, so that might fix the build failure.

@brson
Copy link

brson commented Jul 6, 2017

r? @BurntSushi

@KodrAus
Copy link
Contributor

KodrAus commented Jul 31, 2017

Do you think this one is good to go now @BurntSushi?

@BurntSushi BurntSushi merged commit 079d145 into BurntSushi:master Jul 31, 2017
@BurntSushi
Copy link
Owner

@KodrAus Ah yup, thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants