matprec / rust-font-loader

A font loading utility written in rust.
MIT License
51 stars 21 forks source link

add error handling for fontconfig using failure #21

Closed ashkitten closed 6 years ago

ashkitten commented 6 years ago

Addresses #16

It seems that fontconfig.rs is the only platform that unwraps Results at the moment, so the other platforms just have Result wrappers but never actually produce an Err value.

ashkitten commented 6 years ago

I don't have much time to work on this as I'm focused on other projects, but I'll get back to look over the changes as soon as I can

matprec commented 6 years ago

I can also address some of the stuff in a followup PR on my own, like docs. Just make sure it builds on travis and i'll do the rest on my own :)

ashkitten commented 6 years ago

Looking at the code, it doesn't seem like there's any way for an error to actually occur, at least in query_all and query_specific? I added back some unwraps because they didn't make sense to pass on a result that would never be an error.

ashkitten commented 6 years ago

With that said, I don't really understand the rest of the library, so I'm going to close this PR and hopefully this can be implemented in a better way.