-
Notifications
You must be signed in to change notification settings - Fork 131
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
Include custom pages directory in --show-paths command #184
Closed
dmaahs2017
wants to merge
14
commits into
tealdeer-rs:master
from
dmaahs2017:include_custom_pages_dir_in_show_paths
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6f2557a
include custom pages directory in --show-paths command
dmaahs2017 19fba90
remove use of DirectoryConfig as it was redundant
dmaahs2017 148d333
change RawDirectoryConfig.custom_pages_dir to no longer be an option
dmaahs2017 9bfa8b6
remove dev comment
dmaahs2017 5690dac
expect() instead of unwrap()
dmaahs2017 5208b7e
fix another map which precedes an unwrap
dmaahs2017 c9c4b55
formatting
dmaahs2017 6003887
clippy pedantics
dmaahs2017 f6946c1
String -> &str
dmaahs2017 e209716
println -> eprintln
dmaahs2017 8b32f71
fmt again.. :)
dmaahs2017 03a2f4a
Merge branch 'master' into include_custom_pages_dir_in_show_paths
dmaahs2017 8f298c6
Code Review Changes
dmaahs2017 01ada8b
Merge branch 'master' into include_custom_pages_dir_in_show_paths
dmaahs2017 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 am not really sure if my understanding is correct here, but I thought that all the
Raw*Config
s are just "dumb" data containers, that are "materialized" into meaningful values (with smart defaults and all) when converting to their*Config
counterparts. Then again, this happened here before 🤷♂️@dbrgn why exactly do we have this distinction again?
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.
Yeah I'm not sure either tbh. Kinda reminds me of the DTO pattern, since
RawConfig
is the one that's serializable andConfig
is not.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.
If
PathBuf
is not anOption
, then deserializing a TOML config file without acustom_pages_dir
specified will fail.(Actually, in this case it will use the default value of
PathBuf
due to the annotation, but I'm not sure what that is, and I don't think it's meaningful.)@niklasmohrin is right,
Raw*Config
is purely here for deserializing the config files into Rust-y values, and then the non-raw config objects contain validated and potentially more structured values.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.
@dmaahs2017 can you revert the removal of the options? otherwise we cannot differentiate between someone not setting the path in the config at all (which is valid of course) and someone setting an empty path (which is invalid).
With your change, if I'm not mistaken, the default value will be used if the custom pages dir is not set by the user (which is an empty path). This empty path will be joined with a filename. This means that a user that does not set the custom pages dir, but has a
tldr.tar
file in the current directory, will be served this local file instead of the actual tar page.