Skip to content

Instantly share code, notes, and snippets.

@l0calh05t
l0calh05t / runner.py
Created August 15, 2021 18:32
Running Rust tests/benchmarks remotely using `rsync` and `ssh` on Bela
# no shebang-line as Python scripts aren't really executable on Windows
# use runner = ["python", "runner.py"] in your Cargo config instead
from hashlib import sha3_224
from shlex import quote
import os
import pathlib
import platform
import sys
import subprocess as sp
@l0calh05t
l0calh05t / mul_generic.rs
Created April 26, 2020 08:16
Rust generic op trait pains
use std::ops::Mul;
pub struct Foo<T>(T, T);
// Either of the following traits can be implemented individually, but both together cause an infinite recursion.
// If both traits are limited to a single type T it works fine.
impl<L, R, O> Mul<&Foo<R>> for &Foo<L>
where
for<'l, 'r> &'l L: Mul<&'r R, Output = O>,