diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-08-03 16:01:23 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-08-03 16:04:55 +0200 |
| commit | dbfb3d2ced91e56314dfabbb4df9a338926c0a7a (patch) | |
| tree | 678264cb18f8abc81ebe28077f5aef2df4e5a4bd /src/style.rs | |
| parent | 5a8f2fb73ddafba9fdbe952385ae2676126183ae (diff) | |
Formatting, documentation and small improvements 🧽
Diffstat (limited to 'src/style.rs')
| -rw-r--r-- | src/style.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/style.rs b/src/style.rs index 9dce381e..80389919 100644 --- a/src/style.rs +++ b/src/style.rs @@ -1,7 +1,10 @@ //! Styles for text and pages. -use fontdock::{fallback, FallbackTree, FontVariant, FontStyle, FontWeight, FontWidth}; -use crate::geom::{Size, Margins, Value4}; +use fontdock::{ + fallback, FallbackTree, FontStyle, FontVariant, FontWeight, FontWidth, +}; + +use crate::geom::{Margins, Size, Value4}; use crate::length::{Length, ScaleLength}; use crate::paper::{Paper, PaperClass, PAPER_A4}; @@ -62,8 +65,8 @@ impl TextStyle { } impl Default for TextStyle { - fn default() -> TextStyle { - TextStyle { + fn default() -> Self { + Self { fallback: fallback! { list: ["sans-serif"], classes: { @@ -105,8 +108,8 @@ pub struct PageStyle { impl PageStyle { /// The default page style for the given paper. - pub fn new(paper: Paper) -> PageStyle { - PageStyle { + pub fn new(paper: Paper) -> Self { + Self { class: paper.class, size: paper.size(), margins: Value4::with_all(None), @@ -127,7 +130,7 @@ impl PageStyle { } impl Default for PageStyle { - fn default() -> PageStyle { - PageStyle::new(PAPER_A4) + fn default() -> Self { + Self::new(PAPER_A4) } } |
