Skip to content

JohnScience/push_mut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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);   
}

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages