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

fix: split path string manually #3

Merged

Conversation

chozandrias76
Copy link
Contributor

This should allow users on Linux to parse the virtual path correctly when loading a save file.

@@ -88,7 +88,7 @@ impl Regulation {

for file in &res.files {
let path = PathBuf::from_str(&file.name).unwrap();
Copy link
Owner

@ClayAmore ClayAmore Mar 25, 2024

Choose a reason for hiding this comment

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

You can drop the Pathbuf and just split the file.name directly. I believe it's a String or &str. Make sure to add proper checks for empty. Also last returns a result that maybe an error that needs to be handled.

src/util/regulation.rs Outdated Show resolved Hide resolved
src/util/regulation.rs Show resolved Hide resolved
@ClayAmore ClayAmore merged commit 4325857 into ClayAmore:master Mar 25, 2024
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