RazrFalcon / tiny-skia

A tiny Skia subset ported to Rust
BSD 3-Clause "New" or "Revised" License
1.05k stars 67 forks source link

Add a way to recover a PathBuilder from a failed finish() #74

Closed notgull closed 1 year ago

notgull commented 1 year ago

Right now, PathBuilder::finish() returns an Option<Path>. However, this means that, if the function fails, the allocations used in the PathBuilder are lost. In the interest of preventing unnecessary allocations, it would be nice if there was some error type in PathBuilder::finish() that returned the cleared path.

RazrFalcon commented 1 year ago

This would be an extremely rare case and increasing the API complexity isn't worth it.