From 60a1dbfb070792794bf7090d41a0622303730723 Mon Sep 17 00:00:00 2001 From: relrelb Date: Sun, 29 May 2022 20:54:45 +0300 Subject: [PATCH] swf: Mark some `Matrix` functions as `const` --- swf/src/types/matrix.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swf/src/types/matrix.rs b/swf/src/types/matrix.rs index f160bd66c..ba7144293 100644 --- a/swf/src/types/matrix.rs +++ b/swf/src/types/matrix.rs @@ -51,11 +51,11 @@ impl Matrix { /// Returns a scale matrix. #[inline] - pub fn scale(scale_x: Fixed16, scale_y: Fixed16) -> Self { + pub const fn scale(scale_x: Fixed16, scale_y: Fixed16) -> Self { Self { a: scale_x, d: scale_y, - ..Default::default() + ..Self::IDENTITY } } @@ -73,11 +73,11 @@ impl Matrix { /// Returns a translation matrix. #[inline] - pub fn translate(x: Twips, y: Twips) -> Self { + pub const fn translate(x: Twips, y: Twips) -> Self { Self { tx: x, ty: y, - ..Default::default() + ..Self::IDENTITY } }