Buttons@programming.devtoRust@programming.dev•What are some mind blowing Rust tricks?English
0·
4 months agoWhat if I specify the wrong type? let retrieved = storage.get::<SomeOtherType>();
?
Is it a runtime error or a compile time error?
What if I specify the wrong type? let retrieved = storage.get::<SomeOtherType>();
?
Is it a runtime error or a compile time error?
To answer my own question: I believe it’s a runtime error: https://doc.rust-lang.org/stable/std/any/trait.Any.html#method.downcast