use std::{ ffi::{CStr, OsStr, OsString}, path::{Path, PathBuf}, }; use emplacable::*; #[test] fn into_impls() { let a: &[Box] = &[Box::new(1), Box::new(2), Box::new(3), Box::new(4)]; let _: Box<[Box]> = box_new_with(a.into()); let a: &str = "iiiiii"; let _: Box = box_new_with(a.into()); let a: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"hiii\0") }; let _: Box = box_new_with(a.into()); let a: &OsStr = &OsString::from("a"); let _: Box = box_new_with(a.into()); let a: &Path = &PathBuf::from("a"); let _: Box = box_new_with(a.into()); let a: &str = "iiiiii"; let e: Emplacable = a.into(); let b: Box<[u8]> = box_new_with(e.into()); let _: Box<[u8]> = box_new_with(b.into()); let v: Vec> = vec![Box::new(1), Box::new(2), Box::new(3), Box::new(4)]; let _: Box<[Box]> = box_new_with(v.into()); let a: [Box; 4] = [Box::new(1), Box::new(2), Box::new(3), Box::new(4)]; let e: Emplacable<[Box; 4], _> = a.into(); let _: Box<[Box]> = box_new_with(e.into()); let a: [Emplacable; 4] = [ Box::new(1).into(), Box::new(2).into(), Box::new(3).into(), Box::new(4).into(), ]; let _: Box<[i32; 4]> = box_new_with(a.into()); }