From 073a91d788c4e76095f93548fb9282b07ed77ba9 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Tue, 31 Jan 2023 09:19:14 +0100 Subject: [PATCH] bug(sdk): Fix type conversion recursion The compiler doesn't complain about this, so I assumed it was able to correctly resolve a conversion `BundleFileType` -> `Murmur64` via their shared `From` impl: `u64`. But it appears that is not the case, and the simple `t.into()` just calls itself. So I need to do the conversion via the intermediary value manually. --- lib/sdk/src/bundle/file.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sdk/src/bundle/file.rs b/lib/sdk/src/bundle/file.rs index d5f0c58..2c68185 100644 --- a/lib/sdk/src/bundle/file.rs +++ b/lib/sdk/src/bundle/file.rs @@ -397,7 +397,8 @@ impl From for u64 { } impl From for Murmur64 { fn from(t: BundleFileType) -> Murmur64 { - t.into() + let hash: u64 = t.into(); + Murmur64::from(hash) } }