Re: Unit Type for Rust

2021-06-28 Thread Segher Boessenkool
On Mon, Jun 28, 2021 at 02:51:22PM +0100, Philip Herron wrote: > On 28/06/2021 14:49, Philip Herron wrote: > > In Rust the language has the notion of the unit type '()', so for example: > > > >  fn foo ->i32 { ... } > >  fn bar() { ... } > > > > Foo has the return type i32, and bar has no return ty

Re: Unit Type for Rust

2021-06-28 Thread Philip Herron
On 28/06/2021 14:49, Philip Herron wrote: > Hi everyone, > > In Rust the language has the notion of the unit type '()', so for example: > >  fn foo ->i32 { ... } >  fn bar() { ... } > > Foo has the return type i32, and bar has no return type, which means it > is unit-type so that it can be a value

Unit Type for Rust

2021-06-28 Thread Philip Herron
Hi everyone, In Rust the language has the notion of the unit type '()', so for example:  fn foo ->i32 { ... }  fn bar() { ... } Foo has the return type i32, and bar has no return type, which means it is unit-type so that it can be a value assignable just like any other function call. You can als