Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![no_std]
- extern crate alloc;
- /// ```
- /// assert_eq!(playground::foo().to_string(), "5".to_owned())
- /// ```
- pub fn foo() -> alloc::boxed::Box<dyn core::fmt::Display> {
- alloc::boxed::Box::new(5)
- }
- /// ```
- /// assert_eq!(playground::bar().to_string(), "5".to_owned());
- /// ```
- pub fn bar() -> impl core::fmt::Display {
- 5
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement