Crate upget

Source
Expand description

Provider of Upget.

The author of this crate is not good at English. Forgive me if the document is hard to read.

The Upget trate can be used for refactoring as follows.

Before refactoring.

fn clone_with_sort(vec: &Vec<String>) -> Vec<String> {
    let mut result = vec.clone();
    result.sort();
    result
}

After refactoring.

fn clone_with_sort(vec: &Vec<String>) -> Vec<String> {
    vec.clone().upget(|x| x.sort())
}

Modules§

prelude
Crate’s prelude.

Traits§

Upget
Trait that handles common patterns of updating and getting value.