diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-16 18:52:26 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-16 19:15:03 +0200 |
| commit | 9462fb17b390c57846b9215217ca7c32b649f0a5 (patch) | |
| tree | bd6f96fea83c5e757c8f0eefefe5c0347784f00b /src/paper.rs | |
| parent | cb0aab3cfab2122a87d1d221290f7178b4291758 (diff) | |
Convert single-field structs to tuple structs
Diffstat (limited to 'src/paper.rs')
| -rw-r--r-- | src/paper.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/paper.rs b/src/paper.rs index 03c48f16..1a3391a1 100644 --- a/src/paper.rs +++ b/src/paper.rs @@ -6,7 +6,7 @@ use crate::geom::{Length, Linear, Relative, Sides, Size}; #[derive(Debug, Copy, Clone, PartialEq)] pub struct Paper { /// The broad class this paper belongs to. - pub class: PaperClass, + class: PaperClass, /// The width of the paper in millimeters. width: f64, /// The height of the paper in millimeters. @@ -19,6 +19,11 @@ impl Paper { parse_paper(name) } + /// The class of the paper. + pub fn class(self) -> PaperClass { + self.class + } + /// The size of the paper. pub fn size(self) -> Size { Size::new(Length::mm(self.width), Length::mm(self.height)) |
