feat: traits done

This commit is contained in:
2026-09-11 17:37:48 +02:00
parent b94cdfd4c4
commit 8ded4cc8b5
5 changed files with 14 additions and 3 deletions
+3 -1
View File
@@ -3,7 +3,9 @@ trait Licensed {
// implementors like the two structs below can share that default behavior
// without repeating the function.
// The default license information should be the string "Default license".
fn licensing_info(&self) -> String;
fn licensing_info(&self) -> String {
String::from("Default license")
}
}
struct SomeSoftware {