From ddd0b51bafd321036c5705441de892962f6f043b Mon Sep 17 00:00:00 2001 From: Mossa Date: Fri, 22 Mar 2024 20:11:28 +0100 Subject: [PATCH] refactor: Result-oriented AsTypedSlice for better error messages when type-error occurs. fixed macro-snapshot --- tests/extendrtests/tests/testthat/_snaps/macro-snapshot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/extendrtests/tests/testthat/_snaps/macro-snapshot.md b/tests/extendrtests/tests/testthat/_snaps/macro-snapshot.md index 2abd792f25..9f28548495 100644 --- a/tests/extendrtests/tests/testthat/_snaps/macro-snapshot.md +++ b/tests/extendrtests/tests/testthat/_snaps/macro-snapshot.md @@ -3349,7 +3349,7 @@ return Err(levels_err); } use extendr_api::AsTypedSlice; - let int_vector: &[Rint] = robj.as_typed_slice().unwrap(); + let int_vector: &[Rint] = robj.try_into_typed_slice()?; if int_vector.len() != 1 { return Err(Error::ExpectedScalarFactor(robj.clone())); }