borsh 1.6.1

Binary Object Representation Serializer for Hashing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use alloc::string::ToString;

#[test]
fn test_ref_cell_try_borrow_error() {
    let rcell = core::cell::RefCell::new("str");

    let _active_borrow = rcell.try_borrow_mut().unwrap();

    assert_eq!(
        borsh::to_vec(&rcell).unwrap_err().to_string(),
        "already mutably borrowed"
    );
}