get_char_mut

Function get_char_mut 

Source
pub fn get_char_mut(s: &mut str, i: usize) -> Option<&mut Char>
Expand description

Get a mutable character reference from a mutable str and an index.

use mut_str::get_char_mut;

let mut owned_s = Box::<str>::from("Hello, World!");
let c = get_char_mut(&mut *owned_s, 1).unwrap();

assert_eq!(c, 'e');