-
Notifications
You must be signed in to change notification settings - Fork 225
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
Introduce an option for disabling the automatic resolver in FileSourceFile #133
base: main
Are you sure you want to change the base?
Conversation
I see where this is coming from. First, thanks for the contribution. I agree as well that your solution #3 is probably the best way to handle this. Very minor nit, should we have the option method simply File::with_name("Config.toml").exact(true)
File::with_exact_name("Config.toml") |
I agree it is certainly more coherent and sensible as a name. |
Do you need anything else for the merge? |
Any problems? |
Are you still interested in this? If yes, I created a maintenance fork (read here). |
Can you rebase this to latest master? |
A new feature with granted retro compatibility.
To solve the problem introduced in #132 I have introduced the solution number 3:
The struct File now has two new methods,
with_exact_name
andexact_name
, the first to create a File with a FileSourceFile imposed to not search the extension of the file.With this approach, one can load a file named
Settings.wrongextension
as a Toml file like before, but if the file is missing the program will not search another file named for exampleSettings.yaml
without asking.I've introduced three tests for the new methods, and a very small fix of the wrong extension error message, because before it used the absolute path when the not found error used the relative/given path.