Crates.io | mmut |
lib.rs | mmut |
version | 0.1.0 |
source | src |
created_at | 2019-09-06 13:31:48.100392 |
updated_at | 2019-09-06 13:31:48.100392 |
description | multi mut |
homepage | |
repository | https://github.com/lperlaki/mmut-rs |
max_upload_size | |
id | 162771 |
size | 4,600 |
Get mutalbe references to two locations in Collection by key.
use mmut::MutPair;
let mut v = vec![1, 2, 3, 4, 5];
let (a, b) = v.two_mut(1, 3).unwrap();
*a = 8;
*b = 7;
assert_eq!(v, vec![1, 8, 3, 7, 5]);