Skip to content

Instantly share code, notes, and snippets.

@justanotherdot
Created August 4, 2020 23:15
Show Gist options
  • Save justanotherdot/cdf2702436ccfd91233c15e065d58143 to your computer and use it in GitHub Desktop.
Save justanotherdot/cdf2702436ccfd91233c15e065d58143 to your computer and use it in GitHub Desktop.
FnOnce (auto inferred closure?) cloneable.
fn main() {
let xs = vec![1];
let ys = xs.clone();
let clos = move || xs;
assert_eq!(&(clos.clone())(), &ys);
assert_eq!(&clos(), &ys);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment