diff options
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel/attachment.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/model/channel/attachment.rs b/src/model/channel/attachment.rs index 5d47469..af15bf7 100644 --- a/src/model/channel/attachment.rs +++ b/src/model/channel/attachment.rs @@ -32,11 +32,7 @@ impl Attachment { /// If this attachment is an image, then a tuple of the width and height /// in pixels is returned. pub fn dimensions(&self) -> Option<(u64, u64)> { - if let (Some(width), Some(height)) = (self.width, self.height) { - Some((width, height)) - } else { - None - } + self.width.and_then(|width| self.height.map(|height| (width, height))) } /// Downloads the attachment, returning back a vector of bytes. |