summaryrefslogtreecommitdiff
path: root/exercises/traits/traits4.rs
diff options
context:
space:
mode:
authorAdam Brewer <adamhb321@gmail.com>2023-10-16 07:37:12 -0400
committerAdam Brewer <adamhb321@gmail.com>2023-10-16 07:37:12 -0400
commit64d95837e9813541cf5b357de13865ce687ae98d (patch)
treef022c5d5ba01128811c0b77618a7adb843ee876b /exercises/traits/traits4.rs
parentc3941323e2c0b9ee286494327de92e00f23b9e3a (diff)
Update Exercises Directory Names to Reflect Order
Diffstat (limited to 'exercises/traits/traits4.rs')
-rw-r--r--exercises/traits/traits4.rs49
1 files changed, 0 insertions, 49 deletions
diff --git a/exercises/traits/traits4.rs b/exercises/traits/traits4.rs
deleted file mode 100644
index 4bda3e5..0000000
--- a/exercises/traits/traits4.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-// traits4.rs
-//
-// Your task is to replace the '??' sections so the code compiles.
-//
-// Don't change any line other than the marked one.
-//
-// Execute `rustlings hint traits4` or use the `hint` watch subcommand for a
-// hint.
-
-// I AM NOT DONE
-
-pub trait Licensed {
- fn licensing_info(&self) -> String {
- "some information".to_string()
- }
-}
-
-struct SomeSoftware {}
-
-struct OtherSoftware {}
-
-impl Licensed for SomeSoftware {}
-impl Licensed for OtherSoftware {}
-
-// YOU MAY ONLY CHANGE THE NEXT LINE
-fn compare_license_types(software: ??, software_two: ??) -> bool {
- software.licensing_info() == software_two.licensing_info()
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn compare_license_information() {
- let some_software = SomeSoftware {};
- let other_software = OtherSoftware {};
-
- assert!(compare_license_types(some_software, other_software));
- }
-
- #[test]
- fn compare_license_information_backwards() {
- let some_software = SomeSoftware {};
- let other_software = OtherSoftware {};
-
- assert!(compare_license_types(other_software, some_software));
- }
-}