tmdb_cli/libs/handlers/
helpers.rs

1#[macro_export]
2macro_rules! client {
3  () => {
4    reqwest::Client::builder()
5      .timeout(std::time::Duration::from_secs(30))
6      .build()
7      .expect("failed to build client")
8  }
9}
10
11#[macro_export]
12macro_rules! opt_param {
13  ($params:expr, $name:expr, $opt:expr) => {
14    if let Some(opt) = $opt.as_ref() {
15      $params.push(($name, opt));
16    }
17  }
18}
19