feat: generics done

This commit is contained in:
2026-09-11 17:37:16 +02:00
parent fe01747f82
commit b94cdfd4c4
2 changed files with 5 additions and 5 deletions
+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 }
}
}