Skip to content
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

Add QDir support to rbx_types, rbx_xml, and reflection #322

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kennethloeffler
Copy link
Member

This PR adds QDir to rbx_types (a simple wrapper around PathBuf), QDir (de)serialization to rbx_xml, and also allows rbx_reflector to reflect QDir type properties. It's geared towards the requirements of Kampfkarren/roblox-install#33, but is generally useful when interacting with Roblox Studio settings.

Comment on lines +20 to +22
pub fn path_buf(&'a self) -> &'a PathBuf {
&self.path_buf
}
Copy link
Member

Choose a reason for hiding this comment

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

It feels more reasonable to return a &Path here rather than &PathBuf.

Copy link
Member Author

Choose a reason for hiding this comment

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

This method is intended to be an accessor to the path_buf field (you can already get an &Path via the AsRef<Path> implementation). Thinking about it more, maybe this field doesn't really need an accessor?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what the use is for a field accessor here. Maybe writing, though I don't believe this is how people generally do field mutability in Rust.

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