2 ms·
c'mon... $ cd servo/components $ rg -F 'panic!' | wc -l 276 Likely a fair amount is justifiable, but things like this ? https://github.com/servo/serv
by jcelerier 7y ago
c'mon...
$ cd servo/components
$ rg -F 'panic!' | wc -l
276
Likely a fair amount is justifiable, but things like this ? https://github.com/servo/servo/blob/master/components/script/dom/bindings/structuredclone.rs#L74 https://github.com/servo/servo/blob/master/components/script... or this https://github.com/servo/servo/blob/master/components/gfx/platform/freetype/font_list.rs#L96 https://github.com/servo/servo/blob/master/components/gfx/pl... ?
that's a really strong code smell (or at least doing a similar thing in a C++ program, e.g. calling abort() / SIGTRAP, would be, even with a signal handler, a really really really long discussion in code review)
- steveklabnik 7y agoloc in that same directory says 289958 lines of Rust code, that is a ratio of 0.00095186199. That is pretty small. 175 unwraps, which I am actually shocked is smaller than panics. And yes, I do think that both of these are pretty justifiable: both of these are effectively assertions, which is not unheard of in C either.