Skip to content

Commit 70b78b6

Browse files
committed
style/font: use web font style
The second String is not used anywhere so the Rust compiler will complain like below. The font-style is actually useful so let's set it. warning: field `1` is never read --> /home/adi/workspace/web/deps/plotters/plotters/src/style/font/web.rs:21:37 | 21 | pub struct FontDataInternal(String, String); | ---------------- ^^^^^^ | field in this struct | = note: `FontDataInternal` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis = note: `#[warn(dead_code)]` on by default help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 21 | pub struct FontDataInternal(String, ()); | ~~ warning: `plotters` (lib) generated 1 warning
1 parent 5fccc95 commit 70b78b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plotters/src/style/font/web.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl FontData for FontDataInternal {
3434
let body = document.body().unwrap();
3535
let span = document.create_element("span").unwrap();
3636
span.set_text_content(Some(text));
37-
span.set_attribute("style", &format!("display: inline-block; font-family:{}; font-size: {}px; position: fixed; top: 100%", self.0, size)).unwrap();
37+
span.set_attribute("style", &format!("display: inline-block; font-family:{}; font-style:{}; font-size: {}px; position: fixed; top: 100%", self.0, self.1, size)).unwrap();
3838
let span = span.into();
3939
body.append_with_node_1(&span).unwrap();
4040
let elem = JsCast::dyn_into::<HtmlElement>(span).unwrap();

0 commit comments

Comments
 (0)