slippy-cli 0.1.0

AI Linter for Rust projects
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod exchanger;

pub fn exchange_currency(
    input: Currency,
    output: Currency,
    input_amount: Option<f64>,
    output_amount: Option<f64>,
) -> Result<(), String> {
    if let Some(input_amount) = input_amount {
        return exchanger::exchange_exact_input(input, output, input_amount);
    }

    if let Some(output_amount) = output_amount {
        return exchanger::exchange_exact_output(output, input, output_amount);
    }

    Err("No amount provided".to_string())
}