Skip to content

Commit

Permalink
finish generics
Browse files Browse the repository at this point in the history
  • Loading branch information
Withsan committed Oct 9, 2023
1 parent 6da07ec commit 77ccc7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion exercises/generics/generics1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
// I AM NOT DONE

fn main() {
let mut shopping_list: Vec<?> = Vec::new();
let mut shopping_list = Vec::new();
shopping_list.push("milk");
}
8 changes: 4 additions & 4 deletions exercises/generics/generics2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

// I AM NOT DONE

struct Wrapper {
value: u32,
struct Wrapper<T> {
value: T,
}

impl Wrapper {
pub fn new(value: u32) -> Self {
impl<T> Wrapper<T> {
pub fn new(value: T) -> Self {
Wrapper { value }
}
}
Expand Down

0 comments on commit 77ccc7f

Please sign in to comment.