Skip to content

Commit 9860ec5

Browse files
committed
Use rusttype 0.7.0
1 parent 2e134c1 commit 9860ec5

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

Cargo.lock

Lines changed: 17 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/web/badge/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ path = "badge.rs"
1212

1313
[dependencies]
1414
base64 = "0.9.0"
15-
rusttype = "0.4.0"
15+
rusttype = "0.7"

src/web/badge/badge.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ pub struct Badge {
4444

4545
impl Badge {
4646
pub fn new(options: BadgeOptions) -> Result<Badge, String> {
47-
let collection = FontCollection::from_bytes(FONT_DATA);
47+
let collection = FontCollection::from_bytes(FONT_DATA).expect("Failed to parse FONT_DATA");
4848
// this should never fail in practice
49-
let font = try!(collection.into_font().ok_or("Failed to load font data".to_owned()));
49+
let font = try!(collection.into_font().map_err(|_| "Failed to load font data".to_owned()));
5050
let scale = Scale {
5151
x: FONT_SIZE,
5252
y: FONT_SIZE,

0 commit comments

Comments
 (0)