-
Couldn't load subscription status.
- Fork 64
Improvements #107
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
base: master
Are you sure you want to change the base?
Improvements #107
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.
I like some of the improvements here, but not all. I would prefer to split controversial changes into a separate PR. Also it would be nice if changelog file was also updated
| pub(crate) fn first_cluster(&self) -> Option<u32> { | ||
| /// Return first cluster of a entry. | ||
| #[must_use] | ||
| pub fn first_cluster(&self) -> Option<u32> { |
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.
why make it public? How the user can use this information?
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 use it as a identifier (while a fs is mounted), since it's much simpler than filenames (due to lfn and only Option<u32> to be stored than a full filename - [u8;255]) in my no_std, no_alloc project.
| /// | ||
| /// `path` is a '/' separated directory path relative to self directory. | ||
| /// | ||
| /// An empty path returns the current directory. |
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'm not sure this is a good way to handle this situation. Do you know any other API that behaves like this? What problem does this change solve?
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.
It's a side-effect of how the code is now written.
I can add an extra check to return an error in case of an empty string.
As it turns out, I use it no longer - so is (from my point) not neccessary.
src/dir.rs
Outdated
| return Ok(dir); | ||
| } | ||
| let (name, rest_opt) = split_path(path); | ||
| let e = dir.find_entry(name, Some(true), None)?.to_dir(); |
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.
Name e no longer make sense here. Please remove it and update dir instead
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.
updated
ff91e9a to
e93e767
Compare
e93e767 to
49010b9
Compare
If you tell me what is controversial, I'll remove it (and maybe add in another PR). (I guess it's the directory routine.) Added to changelog. (P.S. I'd also appreciate it if PR #78 and #98 can also be merged.) |
49010b9 to
e7b6f72
Compare
Add some small improvements.