push_mut

Crates.iopush_mut
lib.rspush_mut
version0.1.0
sourcesrc
created_at2023-10-13 19:25:39.71427
updated_at2023-10-13 19:25:39.71427
descriptionPush a value to the back of the vector, and return a mutable reference to it.
homepage
repositoryhttps://github.com/JohnScience/push_mut
max_upload_size
id1002578
size2,736
Dmitrii - Demenev (JohnScience)

documentation

https://docs.rs/push_mut

README

push_mut

Crates.io Downloads Documentation License Dependency Status

Push a value to the back of the vector, and return a mutable reference to it.

Example

use push_mut::PushMut;

fn main() {
    let mut v = Vec::with_capacity(1);
    let last = v.push_mut(1);
    assert_eq!(*last, 1);
    *last = 2;
    assert_eq!(*last, 2);   
}
Commit count: 1

cargo fmt