Skip to content

Commit

Permalink
refactor: Result-oriented AsTypedSlice
Browse files Browse the repository at this point in the history
for better error messages when
type-error occurs.

fixed macro-snapshot
  • Loading branch information
CGMossa committed Mar 22, 2024
1 parent 0e095c6 commit ddd0b51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/extendrtests/tests/testthat/_snaps/macro-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand Down

0 comments on commit ddd0b51

Please sign in to comment.