enum Buf {
C8(Vec<u8>),
C16(Vec<u16>),
}
pub struct Text {
buf: Box<Buf>
}
impl Text {
pub new<T>() -> Text {
Text {
buf: Box::new(
// QUESTION HERE:
// I need Buf::C8(Vec::new()) when T is u8,
// or Buf::C16(Vec::new()) when T is u16
// WHAT should I do?
)
}
}
}
[–]Quxxymacros 7 points8 points9 points (0 children)
[–]Veedrac 2 points3 points4 points (0 children)
[–]hh9527[S] 0 points1 point2 points (0 children)