-
Notifications
You must be signed in to change notification settings - Fork 268
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
Turn InfoField into a trait (big refactoring) #755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Just had one thought.
src/info/deps/mod.rs
Outdated
InfoFieldValue { | ||
r#type: InfoType::Dependencies, | ||
value: self.dependencies.to_string(), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if .type
should be an associated constant, and the return type of value
simplified to just a String
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Thanks for the hint, it simplifies things even more 46d67de
I also removed the InfoFieldValueGetter
trait
This PR introduces the InfoField trait which is implemented by all info lines.
Each implementation of InfoField lives in its own file and encapsulates its logic for formatting and data fetching. As a result, info/mod.rs and repo.rs (renamed to git.rs) are now considerably smaller.
Additional improvements: