On 04/03/2014 22:33, Josh Matthews wrote:
I've started a guide to try and clear up how to use them; please feel free to suggest further topics or make edits yourself:https://github.com/mozilla/servo/wiki/JS-smart-pointers
The guide says:
Downcasting is an unsafe operation, so you must be confident that the cast will succeed or task failure will occur.
Would it make sense to have downcasting return an option? That way you can either match to have different behavior in either case, or use .unwrap() when you expect success.
-- Simon Sapin _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo