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

Fixed unwrap on None when importing embedded assets #10379

Closed
wants to merge 1 commit into from
Closed

Fixed unwrap on None when importing embedded assets #10379

wants to merge 1 commit into from

Conversation

443eb9
Copy link

@443eb9 443eb9 commented Nov 5, 2023

Objective

  • Fixes unwrap on None problem when importing a embedded asset. Just a slight change.

Solution

  • Use the 0th instead of 1th in macro embedded_path!
  • Before:
  • let after_src = file!().split($source_path).nth(1).unwrap();
  • After:
  • let after_src = file!().split($source_path).nth(0).unwrap();

  • The embedded assets can be now imported correctly.

Copy link
Contributor

github-actions bot commented Nov 5, 2023

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@443eb9 443eb9 changed the title Fixed unwrap on None Fixed unwrap on None when importing embedded assets Nov 5, 2023
@bonsairobo
Copy link
Contributor

I think this deserves a more comprehensive fix. I'm working on another PR.

@443eb9
Copy link
Author

443eb9 commented Nov 5, 2023

I think this deserves a more comprehensive fix. I'm working on another PR.

Yeah, definitely. But this simple and quick fix works well in my project. Hope there's no more people being confused by this weird problem. And wish you a smooth completion of your PR. : )

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Assets Load files from disk to use for things like images, models, and sounds labels Nov 8, 2023
@alice-i-cecile
Copy link
Member

Going to move forward with #10383 :) Thanks for the submission regardless, this was helpful to understand the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants