Commit 4b530a2e authored by Arnab Animesh Das's avatar Arnab Animesh Das
Browse files

Make examples compatible with new Rust

parent bcb39347
Pipeline #10130 passed with stages
in 5 minutes and 3 seconds
......@@ -7,10 +7,7 @@ fn main() {
let font_path = std::env::current_dir().unwrap().join(font_path);
let data = std::fs::read(&font_path).unwrap();
Font::try_from_vec(data).unwrap_or_else(|| {
panic!(format!(
"error constructing a Font from data at {:?}",
font_path
));
panic!("error constructing a Font from data at {:?}", font_path);
})
} else {
eprintln!("No font specified ... using WenQuanYiMicroHei.ttf");
......
......@@ -38,7 +38,7 @@ fn main() {
};
// Create a new rgba image with some padding
let mut image = DynamicImage::new_rgba8(glyphs_width + 40, glyphs_height + 40).to_rgba();
let mut image = DynamicImage::new_rgba8(glyphs_width + 40, glyphs_height + 40).to_rgba8();
// Loop through the glyphs in the text, positing each one on a line
for glyph in glyphs {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment