Simplify FontTableMethods::with_buffer

This commit is contained in:
Matt Brubeck 2016-05-18 10:46:37 -07:00
parent 2d5dc8fa6d
commit 1eab6fbb2e
4 changed files with 9 additions and 11 deletions

View file

@ -52,8 +52,8 @@ impl FontTable {
}
impl FontTableMethods for FontTable {
fn with_buffer<F>(&self, blk: F) where F: FnOnce(*const u8, usize) {
blk(self.data.bytes().as_ptr(), self.data.len() as usize);
fn buffer(&self) -> &[u8] {
self.data.bytes()
}
}