1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Boolean encoding utilities.
//!
//! This module provides simple boolean to string conversion functions.
//! These are lower-level utilities; the main encoding uses the `encode`
//! module's `encode_bool` and `decode_bool` functions instead.
//!
//! # Encoding
//!
//! | Value | Encoded |
//! |-------|---------|
//! | `true` | `"T"` |
//! | `false` | `"F"` |
/// Convert boolean to compressed string.
///
/// # Arguments
///
/// * `b` - Boolean value
///
/// # Returns
///
/// `"T"` for true, `"F"` for false
/// Convert compressed string to boolean.
///
/// # Arguments
///
/// * `s` - String "T" or "F"
///
/// # Returns
///
/// `true` for "T", `false` for "F" or empty string