Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #[derive(Debug)]
  2. pub struct Test<T> where T: AsRef<[u8]> {
  3. thing: T,
  4. }
  5.  
  6. fn main() {
  7. let x: Test<String> = make("cats".to_owned());
  8. dbg!(x);
  9. }
  10.  
  11. fn make<T: AsRef<[u8]>>(i: T) -> Test<T> {
  12. Test{
  13. thing: i,
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement