Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- pub struct Test<T> where T: AsRef<[u8]> {
- thing: T,
- }
- fn main() {
- let x: Test<String> = make("cats".to_owned());
- dbg!(x);
- }
- fn make<T: AsRef<[u8]>>(i: T) -> Test<T> {
- Test{
- thing: i,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement