diff --git a/technology/dev/programming/languages/Rust.md b/technology/dev/programming/languages/Rust.md index bc8a09d..11bb7e1 100644 --- a/technology/dev/programming/languages/Rust.md +++ b/technology/dev/programming/languages/Rust.md @@ -148,6 +148,13 @@ fn add_two(a: isize) -> isize { } ``` +The default return type of a function is the Unit Type `()`. You can also signal that a function will never return with `!` +```rust +fn infinity() -> ! { + loop {} +} +``` + ### Enums Rust has enums which can even hold some data. ```rust