Function parse_str

Source
pub fn parse_str(arithmatic: &str) -> Result<Vec<i32>, ErrorKind<'_>>
Expand description

Parses a given [str] into the expected Vec<i32> result.

NOTE: This is the primary function that other parse_x() functions hook onto.

§Examples

use math_calc::{ErrorKind, parse_str};

fn main() {
    let test_operation = "12 + 24, 5 + (4 / (2 + 2))"; // 1: 36, 2: 6

    println!(
        "Result of operation: {:?}",
        parse_str(&test_operation).unwrap()
    );
}