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

Make path to config.toml independent from root dir #1023

Merged
merged 1 commit into from
May 23, 2020
Merged

Make path to config.toml independent from root dir #1023

merged 1 commit into from
May 23, 2020

Conversation

satakuma
Copy link
Contributor

fixes #1022

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

Copy link
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

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

Looks ok to me, I just need to try it locally to make sure I understand well the behaviour.

@@ -62,9 +62,10 @@ impl<'a> SerializedTaxonomyItem<'a> {
impl Site {
/// Parse a site at the given path. Defaults to the current dir
/// Passing in a path is used in tests and when --root argument is passed
pub fn new<P: AsRef<Path>>(path: P, config_file: &str) -> Result<Site> {
pub fn new<P: AsRef<Path>, P2: AsRef<Path>>(path: P, config_file: P2) -> Result<Site> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can reuse P no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would force path and config_file to have the same type, what isn't necessarily required here. One may want to use for example &PathBuf and &str

But yes, currently this function is always called with &PathBuf so it doesn't matter that much + makes this line quite long.

@Keats Keats merged commit 974ae16 into getzola:next May 23, 2020
@Keats
Copy link
Collaborator

Keats commented May 23, 2020

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.

2 participants