multiversx_sc/formatter/formatter_impl_bool.rs
1use super::{FormatByteReceiver, SCDisplay};
2
3const TRUE_BYTES: &[u8] = b"true";
4const FALSE_BYTES: &[u8] = b"false";
5
6impl SCDisplay for bool {
7 fn fmt<F: FormatByteReceiver>(&self, f: &mut F) {
8 if *self {
9 f.append_bytes(TRUE_BYTES);
10 } else {
11 f.append_bytes(FALSE_BYTES);
12 }
13 }
14}