fmt second pass

6-output_list_wrappers-macro
Pierre Réveillon 2021-11-22 09:23:46 +01:00
parent 5513e65cc7
commit e7d7fe6740
1 changed files with 4 additions and 3 deletions

View File

@ -116,9 +116,10 @@ impl Vlm for Instance {
let opts_c: Vec<CString>; let opts_c: Vec<CString>;
let enabled = if enabled { 1 } else { 0 }; let enabled = if enabled { 1 } else { 0 };
if let Some(vec) = options { if let Some(vec) = options {
opts_c = vec.into_iter() opts_c = vec
.map(|x| CString::new(x).expect("Error: Unexpected null byte")) .into_iter()
.collect(); .map(|x| CString::new(x).expect("Error: Unexpected null byte"))
.collect();
opts_c_ptr = opts_c.iter().map(|x| x.as_ptr()).collect(); opts_c_ptr = opts_c.iter().map(|x| x.as_ptr()).collect();
} else { } else {
opts_c_ptr = Vec::new(); opts_c_ptr = Vec::new();