Created
May 1, 2015 18:36
-
-
Save xrl/21bbb0cf26a2cbca5cd4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
error: type `std::io::buffered::BufWriter<&mut [u8]>` does not implement any method in scope named `write_be_u32` | |
writer.write_be_u32::<BigEndian>(interval_ceiling).unwrap(); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
This file contains hidden or 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
use std::io::{ BufWriter, Write }; | |
use byteorder::{ BigEndian, WriteBytesExt }; | |
fn main(){ | |
let mut output_data = [0; 12]; | |
{ | |
let interval_ceiling = 100; | |
let mut buf : &mut [u8] = &mut output_data; | |
let mut writer = BufWriter::new(buf); | |
writer.write_be_u32::<BigEndian>(interval_ceiling).unwrap(); | |
} | |
println!("OUTPUT DATA: {:?}", output_data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment