diff --git a/starlark/src/values/owned.rs b/starlark/src/values/owned.rs index f157c47a..620037f3 100644 --- a/starlark/src/values/owned.rs +++ b/starlark/src/values/owned.rs @@ -140,16 +140,15 @@ impl OwnedFrozenValue { } /// `downcast`, but return an error for human instead of original value. - pub fn downcast_anyhow>( + pub fn downcast_starlark>( self, - ) -> anyhow::Result> { + ) -> crate::Result> { match self.downcast() { Ok(v) => Ok(v), - Err(this) => Err(OwnedError::WrongType( + Err(this) => Err(crate::Error::new_value(OwnedError::WrongType( T::TYPE, this.value.to_value().to_string_for_type_error(), - ) - .into()), + ))), } }