Skip to content

Instantly share code, notes, and snippets.

View BSN4's full-sized avatar
🎯
Focusing

Bader BSN4

🎯
Focusing
View GitHub Profile
@BSN4
BSN4 / collect.rs
Created February 23, 2025 12:45
laravel collection in rust
use std::collections::{HashMap, HashSet};
use std::hash::Hash;
pub struct Collection<'a, T> {
items: Vec<&'a T>,
}
impl<'a, T> Collection<'a, T> {
pub fn new(items: &'a [T]) -> Self {
Self {