Kust
Write Rust like you never left Kotlin.
Kust aims to make new Rustaceans, familiar with Kotlin, feel right at home. It's also aimed to bring a few of Kotlin's goodies to the existing Rust community, without compromising on any of Rust's benefits.
Scope functions
Perform side effects and modify objects in a more concise and readable way.
Available functions:
using- use a value in an expression without creating a new variable (returns a new value)also- perform a side effect using a value without modifying it (returns the same value)apply- modify a value before returning it (returns the same value)
[!NOTE] The Kotlin
letfunction has been renamed tousing, as theletkeyword is reserved in Rust.
See Kotlin documentation.
Examples
Using
use Person;
use ScopeFunctions;
Also
use ComplexType;
use ScopeFunctions;
Apply
use Person;
use ScopeFunctions;