Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created June 4, 2020 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/c98870b7d1aabe278c185af18ea16cd9 to your computer and use it in GitHub Desktop.
Save rust-play/c98870b7d1aabe278c185af18ea16cd9 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
pub fn func_a<T: AsRef<[u8]>>(input: T) -> Vec<u8> {
unimplemented!()
}
pub fn func_b<F>(func: F)
where
F: Fn(&[u8]) -> Vec<u8>,
{
let input: Vec<u8> = vec![0, 1, 2, 3];
let output = func(input.as_ref());
unimplemented!()
}
fn main() {
func_b(func_a)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment