Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. use std::fmt;
  2.  
  3. struct Embed<T>(T);
  4. impl<T: fmt::Debug> fmt::Debug for Embed<T> {
  5. fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  6. write!(f, "\u{2068}{:?}\u{2069}", self.0)
  7. }
  8. }
  9.  
  10. fn main() {
  11. let arr = [
  12. "א",
  13. "ב",
  14. "ג",
  15. "a",
  16. "b",
  17. "c",
  18. ];
  19. println!("without embedding: {:?}", arr);
  20. println!("with embedding: {:?}", Embed(arr));
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement