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

Remove panicking assert #61

Open
acarl005 opened this issue Feb 20, 2025 · 3 comments · May be fixed by #62
Open

Remove panicking assert #61

acarl005 opened this issue Feb 20, 2025 · 3 comments · May be fixed by #62

Comments

@acarl005
Copy link

Hello, there are several assert!s in font_family::FontFamily, eg:

assert!(hr == 0);

Unfortunately, these are crashing our app. Can this crate provide fallible versions of these which return a Result instead so that we can recover from this error in a non-panicking way?

@acarl005
Copy link
Author

acarl005 commented Feb 20, 2025

I'm happy to make a PR if desired. Perhaps an analogous set of methods like try_get_font(&self, index: u32) -> Result<Font>, etc. can be added alongside the existing ones?

@jdm
Copy link
Member

jdm commented Feb 20, 2025

Making those methods fallible sounds reasonable to me!

@acarl005 acarl005 linked a pull request Feb 20, 2025 that will close this issue
@acarl005
Copy link
Author

Awesome! I've submitted a PR please let me know what you think.

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 a pull request may close this issue.

2 participants