You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wouldn't it be more idiomatic to return Result instead of asserting hr == 0 all over the place?
Not exposing the abillity to fail and instead panicing makes the api unidiomatic in my opinion, since e.g. FontDescriptor can be manipulated by the user, which in turn can cause hr != 0.
The text was updated successfully, but these errors were encountered:
Probably -- the way the code evolved the hr == 0 assertions just lived on through. I'm open to making this API change later on. Note that things that can safely fail such as get_font_from_descriptor and stuff like FontCollection::get_font_family_by_name return Option. They only panic in case of bad/usage failure (I think). For example, calling FontCollection::get_font_family with an index that's out of range causes an assertion failure/panic.
kwonoj
pushed a commit
to kwonoj/dwrote-rs
that referenced
this issue
Jul 8, 2018
Wouldn't it be more idiomatic to return Result instead of asserting
hr == 0
all over the place?Not exposing the abillity to fail and instead panicing makes the api unidiomatic in my opinion, since e.g. FontDescriptor can be manipulated by the user, which in turn can cause
hr != 0
.The text was updated successfully, but these errors were encountered: