letdata=&[/* buffer acquired somewhere */];
/// in_unicode will be Cow::Borrowed if data only contains overlapping characters,/// or Cow::Owned if a conversion needed to have been made.letin_unicode=Cow::borrow_from_cp437(data, &CP437_CONTROL);
// Also valid:letin_unicode=String::borrow_from_cp437(data, &CP437_CONTROL);

Moving out of a buffer:

letdata=vec![/* buffer moved in from somewhere */];
/// data is moved out of and zero-alloced into in_unicode/// if it only contains overlapping charactersletin_unicode=String::from_cp437(data, &CP437_CONTROL);

Borrowing from a &str:

letdata="Some string.";
/// in_cp437 will be Cow::Borrowed if data only contains overlapping characters,/// Cow::Owned if a conversion needed to have been made,/// or Err, if data can't be represented as cp437letin_cp437=data.to_cp437(&CP437_CONTROL);
// Also valid (String is AsRef<str>):letdata="Some string.".to_string();
letin_cp437=data.to_cp437(&CP437_CONTROL);

Moving out of a String:

letdata="Some string.".to_string();
/// data is moved out of and zero-alloced into in_cp437/// if it only contains overlapping charactersletin_cp437=data.into_cp437(&CP437_CONTROL);