Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let x: TheStruct<String> = TheStruct::new();
- }
- struct TheStruct<T> {
- val: T,
- }
- impl<String> TheStruct<String> {
- fn new() -> Self {
- let x = String::new();
- TheStruct {
- val: x
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement