Skip to content

Instantly share code, notes, and snippets.

View nicksaperov's full-sized avatar
:fishsticks:

Nick Saperov nicksaperov

:fishsticks:
View GitHub Profile
@nicksaperov
nicksaperov / main.rs
Created October 8, 2025 07:32
Rust Course Project: Banking System with Error Handling
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,
@nicksaperov
nicksaperov / main.rs
Created October 8, 2025 07:02
Rust - Custom Filtering Function
pub struct FilterCondition<T> {
pub value: T,
}
impl<T> FilterCondition<T>
where
T: PartialEq,
{
pub fn is_match(&self, item: &T) -> bool {