From 71fe1d01f3c00815584f6c95a1e27d0937c6606e Mon Sep 17 00:00:00 2001 From: wackbyte Date: Thu, 6 Apr 2023 00:50:21 -0400 Subject: [PATCH] Make `Id::sym` and `Id::trans` into `const fn`s --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6e13ac8..13274f1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -180,11 +180,11 @@ impl Id { } /// Converts `Id` into `Id` since type equality is symmetric. - pub fn sym(self) -> Id { Id(PhantomData) } + pub const fn sym(self) -> Id { Id(PhantomData) } /// If you have proofs `Id` and `Id` you can conclude `Id` /// since type equality is transitive. - pub fn trans(self, _: Id) -> Id { Id(PhantomData) } + pub const fn trans(self, _: Id) -> Id { Id(PhantomData) } /// Casts a value of type `&S` to `&T` where `S == T`. ///