Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn weird_function() -> (u8, Vec<u8>) {
- let (mut a, mut b) = (0, Vec::new());
- for i in 0..256 {
- b = b"string".to_vec();
- a = i;
- }
- (a, b) // Change this to (a as u8, b) and it works
- }
- fn main() {
- println!(
- "weird_function: {}",
- String::from_utf8(weird_function().1).unwrap()
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement