From a59396bca7427d1485ba983475d75ca6286483d5 Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Fri, 8 Jul 2022 18:49:47 +0200 Subject: [PATCH] Update src/compute/cast/dictionary_to.rs Co-authored-by: Jorge Leitao --- src/compute/cast/dictionary_to.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compute/cast/dictionary_to.rs b/src/compute/cast/dictionary_to.rs index acd22b9a90a..101669f6442 100644 --- a/src/compute/cast/dictionary_to.rs +++ b/src/compute/cast/dictionary_to.rs @@ -92,8 +92,7 @@ where Box::new(values.data_type().clone()), is_ordered, ); - // Safety - // we errored if any cast overflowed + // Safety: this is safe because given a type `T` that fits in a `usize`, casting it to type `P` either overflows or also fits in a `usize` unsafe { DictionaryArray::try_new_unchecked(data_type, casted_keys, values.clone()) } } }