pli
use aok::Result;
use pli::Pli;
use static_init::constructor;
#[constructor(0)]
extern "C" fn init() {
loginit::init()
}
#[test]
fn test() -> Result<()> {
let mut txt_li = vec![
"0 hello".to_string(),
"1 world".to_string(),
"2 rust".to_string(),
];
let pos_li = vec![2, 0, 1];
let mut li_proxy = Pli::new(&mut txt_li, pos_li);
for item in li_proxy.iter() {
println!("{}", item);
}
println!("{}", li_proxy[0]); li_proxy[0] = "set 2".to_string();
println!("{}", li_proxy[0]);
{
for mut i in li_proxy.iter_mut() {
*i = "xx".into();
break;
}
}
{
dbg!(&txt_li);
}
Ok(())
}