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

[tech] minor refactoring #620

Merged
merged 1 commit into from
May 5, 2020
Merged

Conversation

patochectp
Copy link
Member

No description provided.

@@ -269,7 +269,7 @@ pub struct Configuration<P: AsRef<Path>> {
pub on_demand_transport_comment: Option<String>,
}

fn read<H>(file_handler: &mut H, configuration: Configuration<impl AsRef<Path>>) -> Result<Model>
fn read<H, P: AsRef<Path>>(file_handler: &mut H, configuration: Configuration<P>) -> Result<Model>
Copy link
Contributor

Choose a reason for hiding this comment

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

I was pretty happy with your proposition of using impl AsRef<Path> actually. The only difference between the 2 propositions being that one is giving a name to the generic (P here). This could be useful if you have to use it somewhere else but in this case, you don't. So I find impl AsRef<Path> simpler because it avoid the complexity of a new variable name. But whichever you choose to keep, I'm fine with it.

@ArnaudOggy ArnaudOggy merged commit 9b82ece into hove-io:master May 5, 2020
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