Skip to content

v0.8.0 (2024-10-31)

Compare
Choose a tag to compare
@github-actions github-actions released this 31 Oct 01:10

Release Notes

New feature

Like anyhow, now you can use ? to propagate any error that implements the
std::error::Error trait.

#[savvy]
fn no_such_file() -> savvy::Result<()> {
    // previously, you had to write .map_err(|e| e.to_string().into())
    let _ = std::fs::read_to_string("no_such_file")?;
    Ok(())
}

If you want to implement your own error type and the conversion to
savvy::Error, please specify use-custom-error feature to opt-out the
auto-conversion to avoid conflict with impl From<dyn std::error::Error> for savvy::Error

savvy = { version = "...", features = ["use-custom-error"] }

Breaking change

By introducing the anyhow-like conversion, savvy loses the error conversion from
a string (e.g. Err("foo".into())). Instead, please use savvy_err!() macro,
which is a shorthand of Error::new(format!(...)).

#[savvy]
fn raise_error() -> savvy::Result<savvy::Sexp> {
    Err(savvy_err!("This is my custom error"))
}

Minor improvements

  • NumericScalar::as_usize() and NumericSexp::iter_usize() now rejects
    numbers larger than 2^32 on 32-bit targets (i.e. webR). Thanks @eitsupi!

Install savvy-cli 0.8.0

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/yutannihilation/savvy/releases/download/v0.8.0/savvy-cli-installer.sh | sh

Download savvy-cli 0.8.0

File Platform Checksum
savvy-cli-aarch64-apple-darwin.tar.xz Apple Silicon macOS checksum
savvy-cli-x86_64-apple-darwin.tar.xz Intel macOS checksum
savvy-cli-x86_64-pc-windows-msvc.zip x64 Windows checksum
savvy-cli-aarch64-unknown-linux-gnu.tar.xz ARM64 Linux checksum
savvy-cli-x86_64-unknown-linux-gnu.tar.xz x64 Linux checksum