From 84c44984b1fd8975bdd195e3b5c9077c4c9c5e55 Mon Sep 17 00:00:00 2001 From: Patrick Owen Date: Fri, 12 Aug 2022 01:33:11 -0400 Subject: [PATCH] Use #[inline] to improve opt-level 1 performance --- src/base/dimension.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/base/dimension.rs b/src/base/dimension.rs index 4be97586..b1b700d7 100644 --- a/src/base/dimension.rs +++ b/src/base/dimension.rs @@ -252,14 +252,17 @@ pub trait ToTypenum { } unsafe impl Dim for Const { + #[inline] fn try_to_usize() -> Option { Some(T) } + #[inline] fn value(&self) -> usize { T } + #[inline] fn from_usize(dim: usize) -> Self { assert_eq!(dim, T); Self