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
56
57
58
59
60
61
/// Ternary Operator with Functions
///
/// Executes one of two functions based on a condition and returns the result.
///
/// # Arguments
///
/// * `condition` - A boolean condition determining which function to execute.
/// * `if_func` - A function that will be executed if the condition is true.
/// * `else_func` - A function that will be executed if the condition is false.
///
/// # Returns
///
/// The result of the executed function.
///
/// # Examples
///
/// ```
/// use lo_::ternary_f;
/// fn add() -> i32 {
/// 5 + 3
/// }
///
/// fn subtract() -> i32 {
/// 5 - 3
/// }
///
/// let result_add = ternary_f(true, add, subtract);
/// assert_eq!(result_add, 8);
///
/// let result_sub = ternary_f(false, add, subtract);
/// assert_eq!(result_sub, 2);
///
/// ```