Skip to content

Instantly share code, notes, and snippets.

View DerekStrickland's full-sized avatar

Derek Strickland DerekStrickland

View GitHub Profile
@DerekStrickland
DerekStrickland / gist:1d6147d9b1f75d8cec42728543b8aee4
Created May 1, 2020 16:18 — forked from leonardo-m/gist:6e9315a57fe9caa893472c2935e9d589
A selection of 101 LINQ Samples converted to Rust
// Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3.
#![feature(ordering_chaining, step_by)]
fn main() {
// linq5: Where - Indexed
/*
//c#
public void Linq5()
{
//Addapted from this page http://lostechies.com/derickbailey/2012/10/07/javascript-mixins-beyond-simple-object-extension/
module Mixer {
// build a mixin function to take a target that receives the mixin,
// a source that is the mixin, and a list of methods / attributes to
// copy over to the target
export function mix(target, source, methodNames){
// ignore the actual args list and build from arguments so we can
// be sure to get all of the method names