-
-
Save rust-play/c98870b7d1aabe278c185af18ea16cd9 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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