-
Notifications
You must be signed in to change notification settings - Fork 1
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 : has module uses profile impl. #25
Conversation
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.
This currently checks if the file can be read. A simple check whether the file exists, can be done like this.
let profile = Profile::new(profile_name, ProfileFlags::default()).unwrap(); // We could also exclude LOOKUP_CWD if we want.
if let Some(path) = profile.path() {
...
Have you suggestions for the profile::Profile
docs to make them easier, so other people can understand the concept of how to use profile::Profile
the best way?
let flags = ProfileFlags::default();
match Profile::new(profile_name, flags) {
Ok(profile) => ...,
Err(err) => unreachable!("Profile::new always returns Ok(_) if called w/o READ flag ATM"),
} What I suggested: let flags = ProfileFlags::default();
match Profile::new(profile_name, flags).unwrap().path() {
Some(path) => // found at path,
None => // not found,
} |
Does this look ok? @rusty-snake |
The profile thing yes. However IMHO it should use (https://rust-lang.github.io/rust-clippy/rust-1.46.0/index.html#single_match_else if you want.) |
refactor : logs in has mod.
6cb60c7
to
735c83a
Compare
Thanks for this contribution! |
Progresses issues #17
@rusty-snake