Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.34 KB | None | 0 0
  1. fn weird_function() -> (u8, Vec<u8>) {
  2.     let (mut a, mut b) = (0, Vec::new());
  3.     for i in 0..256 {
  4.         b = b"string".to_vec();
  5.         a = i;
  6.     }
  7.     (a, b) // Change this to (a as u8, b) and it works
  8. }
  9.  
  10. fn main() {
  11.     println!(
  12.         "weird_function: {}",
  13.         String::from_utf8(weird_function().1).unwrap()
  14.     );
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement