From dbfb3d2ced91e56314dfabbb4df9a338926c0a7a Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 3 Aug 2020 16:01:23 +0200 Subject: =?UTF-8?q?Formatting,=20documentation=20and=20small=20improvement?= =?UTF-8?q?s=20=F0=9F=A7=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/paper.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/paper.rs') diff --git a/src/paper.rs b/src/paper.rs index e8913d12..97f76703 100644 --- a/src/paper.rs +++ b/src/paper.rs @@ -16,7 +16,7 @@ pub struct Paper { impl Paper { /// The paper with the given name. - pub fn from_name(name: &str) -> Option { + pub fn from_name(name: &str) -> Option { parse_paper(name) } @@ -39,7 +39,6 @@ pub enum PaperClass { impl PaperClass { /// The default margins for this page class. pub fn default_margins(self) -> Value4 { - use PaperClass::*; let values = |l, t, r, b| Value4::new( ScaleLength::Scaled(l), ScaleLength::Scaled(t), @@ -48,11 +47,11 @@ impl PaperClass { ); match self { - Custom => values(0.1190, 0.0842, 0.1190, 0.0842), - Base => values(0.1190, 0.0842, 0.1190, 0.0842), - US => values(0.1760, 0.1092, 0.1760, 0.0910), - Newspaper => values(0.0455, 0.0587, 0.0455, 0.0294), - Book => values(0.1200, 0.0852, 0.1500, 0.0965), + Self::Custom => values(0.1190, 0.0842, 0.1190, 0.0842), + Self::Base => values(0.1190, 0.0842, 0.1190, 0.0842), + Self::US => values(0.1760, 0.1092, 0.1760, 0.0910), + Self::Newspaper => values(0.0455, 0.0587, 0.0455, 0.0294), + Self::Book => values(0.1200, 0.0852, 0.1500, 0.0965), } } } -- cgit v1.2.3