Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #![no_std]
  2.  
  3. extern crate alloc;
  4.  
  5. /// ```
  6. /// assert_eq!(playground::foo().to_string(), "5".to_owned())
  7. /// ```
  8. pub fn foo() -> alloc::boxed::Box<dyn core::fmt::Display> {
  9. alloc::boxed::Box::new(5)
  10. }
  11.  
  12. /// ```
  13. /// assert_eq!(playground::bar().to_string(), "5".to_owned());
  14. /// ```
  15. pub fn bar() -> impl core::fmt::Display {
  16. 5
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement