I hereby claim:
- I am hgzimmerman on github.
- I am hzimmerman (https://keybase.io/hzimmerman) on keybase.
- I have a public key ASDOpYR6KUSgZSceq1Ui81OSaxn34pu7r_w_s8k7cslXBwo
To claim this, I am signing this object:
| //! # From SQL Function | |
| //! | |
| //! Probably 90% ready for general use, it should generate compatible output with the `diesel::table!()` | |
| //! macro with the exception of the code commented out on the bottom of the main section. | |
| //! | |
| //! I ended up going in another direction and didn't end up using this in production, but for some time, | |
| //! it replaced an ineffecient view with a marginally more performant function, and all of our tests passed, | |
| //! so I think its usable. | |
| //! | |
| //! |
| pub(crate) fn extract_type_from_callback(ty: &syn::Type) -> Option<&syn::Type> { | |
| use syn::{GenericArgument, Path, PathArguments, PathSegment}; | |
| fn extract_type_path(ty: &syn::Type) -> Option<&Path> { | |
| match *ty { | |
| syn::Type::Path(ref typepath) if typepath.qself.is_none() => Some(&typepath.path), | |
| _ => None, | |
| } | |
| } |
| macro_rules! debug_dbg { | |
| ($($x: tt)*) => {{ | |
| if cfg!(debug_assertions) { | |
| dbg!($($x)*) | |
| } else { | |
| $($x)* | |
| } | |
| }} | |
| } |
| use std::sync::Arc; | |
| use std::sync::RwLock; | |
| use std::hash::Hash; | |
| use std::collections::HashMap; | |
| fn main () { | |
| let m: Memoizer<i64,i64> = Memoizer::default(); | |
| let yeet = m.memoize(5, simple_fn); | |
| assert_eq!(*yeet, 100); | |
| let yeet = m.memoize(5, simple_fn); |
| # This works for me with cargo-web (Yew) | |
| with import <nixpkgs> { | |
| overlays = map (uri: import (fetchTarball uri)) [ | |
| https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz | |
| ]; | |
| }; | |
| stdenv.mkDerivation { | |
| name = "rust-wasm"; | |
| buildInputs = [ |
I hereby claim:
To claim this, I am signing this object: