expect_soft

Crates.ioexpect_soft
lib.rsexpect_soft
version0.1.2
created_at2023-09-29 16:14:52.682771+00
updated_at2025-04-14 19:25:56.269143+00
descriptionDEPRECATED, ARCHIVED, UNSUPPORTED. See readme for more information
homepage
repositoryhttps://github.com/modtk/expect_soft
max_upload_size
id987560
size11,331
rosidae0 (rosidae)

documentation

README

expect_soft

This library has been retired in favor of Rust's native set_hook.

A small utility that was designed to provide a softer alternative to Rust's .expect() method. Instead of panicking, it prints an error message and exits the program. This was made before I knew about the set_hook built-in function.

use expect_soft::ExpectSoft;
use std::fs;

fn main() {
  fs::read_to_string("./readme.md").expect_soft("readme.md could not be found");
}
Commit count: 7

cargo fmt