Skip to content

Conversation

@alexkazik
Copy link

Add some small improvements.

Copy link
Owner

@rafalh rafalh left a 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> {
Copy link
Owner

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?

Copy link
Author

@alexkazik alexkazik Aug 11, 2025

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.
Copy link
Owner

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?

Copy link
Author

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();
Copy link
Owner

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

Copy link
Author

Choose a reason for hiding this comment

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

updated

@alexkazik
Copy link
Author

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

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.)

@alexkazik alexkazik requested a review from rafalh August 11, 2025 11:30
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