|
|
|
|
|
by steveklabnik
3890 days ago
|
|
Say you have a library which has some kind of internal state, and the consistency of said internal state is important for memory safety, as other operations rely on it. Using assert! to verify that your state is consistent is useful, in case you have a bug. But since it's all internal, it's not something that the caller can really recover from, either. It's not their fault, it's yours. |
|
Worst of all, it leads to untestable code, because the calling test case can't properly check the error against some known result.