feat: completed solutions

This commit is contained in:
2026-03-23 03:36:33 -04:00
parent 2279bea6f1
commit f568c094cb
65 changed files with 424 additions and 139 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ fn main() {
// TODO: Fix the compiler error by annotating the type of the vector
// `Vec<T>`. Choose `T` as some integer type that can be created from
// `u8` and `i8`.
let mut numbers = Vec::new();
let mut numbers: Vec<i32> = Vec::new();
// Don't change the lines below.
let n1: u8 = 42;
+4 -4
View File
@@ -1,12 +1,12 @@
// This powerful wrapper provides the ability to store a positive integer value.
// TODO: Rewrite it using a generic so that it supports wrapping ANY type.
struct Wrapper {
value: u32,
struct Wrapper<T> {
value: T,
}
// TODO: Adapt the struct's implementation to be generic over the wrapped value.
impl Wrapper {
fn new(value: u32) -> Self {
impl<T> Wrapper<T> {
fn new(value: T) -> Self {
Wrapper { value }
}
}