-
-
Notifications
You must be signed in to change notification settings - Fork 582
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
Refactor and shorten component creation #1370
Conversation
I like the idea. I would like to move forward with this. please rebase again and resolve the merge conflicts! |
c5f06a1
to
c6e4713
Compare
@extrawurst perhaps another look at this? |
@@ -35,28 +35,18 @@ impl ChangesComponent { | |||
//TODO: fix | |||
#[allow(clippy::too_many_arguments)] |
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.
is this fixed by the change? can it be removed?
key_config: SharedKeyConfig, | ||
options: SharedOptions, | ||
) -> Self { | ||
pub fn new(env: &crate::app::Environment) -> Self { |
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.
so far the other places import this instead of fully-qualifying. lets stay consistent
|
||
/// The need to construct a "whatever" environment only arises in testing right now | ||
#[cfg(test)] | ||
impl Default for Environment { |
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.
does it need to be the Default
trait though? lets make it explicit and just make it a static fn new_test_env
theme: Default::default(), | ||
key_config: Default::default(), | ||
repo: RefCell::new(RepoPath::Path(Default::default())), | ||
options: Default::default(), |
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.
same for Options::default
@@ -32,6 +32,17 @@ pub struct Options { | |||
data: OptionsData, | |||
} | |||
|
|||
#[cfg(test)] | |||
impl Default for Options { |
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.
see above
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.
obviously just nitpick. good work! sorry for the delay
@alexmaco are you still on this? |
made these cleanups myself now and will merge as part of #2043 |
It changes the following:
I followed the checklist:
make check
without errors