This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Account { | |
fn deposit(&mut self, amount: f64) -> Result<(), String>; | |
fn withdraw(&mut self, amount: f64) -> Result<(), String>; | |
fn balance(&self) -> f64; | |
} | |
struct BankAccount { | |
account_number: String, | |
holder_name: String, | |
balance: f64, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct FilterCondition<T> { | |
pub value: T, | |
} | |
impl<T> FilterCondition<T> | |
where | |
T: PartialEq, | |
{ | |
pub fn is_match(&self, item: &T) -> bool { |