From 4dfc11d74ab02ac5765ae5d08fb750c91f4744b4 Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Fri, 2 Oct 2026 21:53:51 -0500 Subject: rustlings: move to rust/ --- rustlings/solutions/15_traits/traits4.rs | 35 -------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 rustlings/solutions/15_traits/traits4.rs (limited to 'rustlings/solutions/15_traits/traits4.rs') diff --git a/rustlings/solutions/15_traits/traits4.rs b/rustlings/solutions/15_traits/traits4.rs deleted file mode 100644 index 3675b8d..0000000 --- a/rustlings/solutions/15_traits/traits4.rs +++ /dev/null @@ -1,35 +0,0 @@ -trait Licensed { - fn licensing_info(&self) -> String { - "Default license".to_string() - } -} - -struct SomeSoftware; -struct OtherSoftware; - -impl Licensed for SomeSoftware {} -impl Licensed for OtherSoftware {} - -fn compare_license_types(software1: impl Licensed, software2: impl Licensed) -> bool { - // ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ - software1.licensing_info() == software2.licensing_info() -} - -fn main() { - // You can optionally experiment here. -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn compare_license_information() { - assert!(compare_license_types(SomeSoftware, OtherSoftware)); - } - - #[test] - fn compare_license_information_backwards() { - assert!(compare_license_types(OtherSoftware, SomeSoftware)); - } -} -- cgit v1.2.3