mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-12 20:33:51 +02:00
feat: traits done
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user