neocurl 2.0.5

A command line tool to test servers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use pyo3::{prelude::*, wrap_pyfunction};

#[pyfunction]
fn env(var: String) -> PyResult<Option<String>> {
    if dotenv::dotenv().is_ok() {
        Ok(dotenv::var(var).ok())
    } else {
        Ok(std::env::var(var).ok())
    }
}

pub fn register(module: &Bound<'_, PyModule>) -> PyResult<()> {
    module.add_function(wrap_pyfunction!(env, module)?)?;

    Ok(())
}