multiversx_sc/formatter/
formatter_impl_bool.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::{FormatByteReceiver, SCDisplay};

const TRUE_BYTES: &[u8] = b"true";
const FALSE_BYTES: &[u8] = b"false";

impl SCDisplay for bool {
    fn fmt<F: FormatByteReceiver>(&self, f: &mut F) {
        if *self {
            f.append_bytes(TRUE_BYTES);
        } else {
            f.append_bytes(FALSE_BYTES);
        }
    }
}