Parcourir la Source

Merge the two `impl` blocks for PNGImage

Lucas Stadler 10 ans auparavant
Parent
commit
b030f12a8e
1 fichiers modifiés avec 4 ajouts et 6 suppressions
  1. 4 6
      rust/coffi/src/main.rs

+ 4 - 6
rust/coffi/src/main.rs

@ -26,15 +26,13 @@ impl PNGImage {
26 26
        return img
27 27
    }
28 28
29
    fn begin_read_from_file(&mut self, file_name: *const libc::c_char) -> u32 {
30
        unsafe { png_image_begin_read_from_file(self, file_name) as u32 }
31
    }
32
}
33
34
impl PNGImage {
35 29
    fn message(&self) -> String {
36 30
        String::from_utf8(self.message.iter().map(|&c| c as u8).collect()).unwrap()
37 31
    }
32
33
    fn begin_read_from_file(&mut self, file_name: *const libc::c_char) -> u32 {
34
        unsafe { png_image_begin_read_from_file(self, file_name) as u32 }
35
    }
38 36
}
39 37
40 38
impl std::fmt::Display for PNGImage {