Skip to content

Conversation

jplatte
Copy link
Contributor

@jplatte jplatte commented May 1, 2021

#195 with some adjustments to have the pipe as enum variant data instead of a separate field.

pub(in crate::fmt) struct Buffer {
inner: termcolor::Buffer,
test_target: Option<Target>,
test_target: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change I'm not so sure about. I haven't really tried to understand the surrounding code, but it was the easiest fix.

I am confident that the behavior is still the same as before, but maybe there was some reason the test target was being stored before? Also, having the same field name as in BufferWriter but a different type seems like a code smell, but I couldn't really come up with something better due to lack of understanding of the code overall.

Copy link
Contributor

@TilCreator TilCreator May 2, 2021

Choose a reason for hiding this comment

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

At first I was a bit confused, but I can not find anything wrong and I think it's an improvement.
Maybe rename Buffer::test_target to Buffer::is_test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll check again how it's used and rename either to is_test or sth. like has_test_target.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ye, I do agree on the has_test_target.

@jplatte
Copy link
Contributor Author

jplatte commented May 1, 2021

@TilCreator please have a look.

cc @sirwindfield, maybe you want to review the overall changes again?

@jplatte jplatte force-pushed the custom_target_logging branch from 483db73 to 5a8cf8e Compare May 1, 2021 20:38
@mainrs
Copy link
Contributor

mainrs commented May 12, 2021

Sure, I'll do it on Saturday! Sorry for the long delay, university has been eating up all my time.

@mainrs
Copy link
Contributor

mainrs commented May 22, 2021

Doing it this evening, sorry for the delay :(

@mainrs mainrs self-assigned this May 22, 2021
Copy link
Contributor

@mainrs mainrs left a comment

Choose a reason for hiding this comment

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

Looks good to me!
I am still confused on why clippy didn't pick up the len() > 0 statements and recommended is_empty() instead. Pretty sure there was a lint for that.

pub(in crate::fmt) struct Buffer {
inner: termcolor::Buffer,
test_target: Option<Target>,
test_target: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ye, I do agree on the has_test_target.

@jplatte jplatte enabled auto-merge (squash) May 25, 2021 10:05
@jplatte jplatte merged commit 1a8379a into master May 25, 2021
@jplatte jplatte deleted the custom_target_logging branch May 25, 2021 10:11
@jplatte jplatte mentioned this pull request Jun 11, 2021
@epage epage mentioned this pull request Nov 10, 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

Successfully merging this pull request may close these issues.

3 participants