File: via_single_provider.rs

package info (click to toggle)
rust-urlshortener 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 208 kB
  • sloc: makefile: 4
file content (14 lines) | stat: -rw-r--r-- 360 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Generate a short URL by specifying which provider to use.

extern crate urlshortener;

use urlshortener::{client::UrlShortener, providers::Provider};

fn main() {
    let long_url = "https://doc.rust-lang.org/std/";

    let us = UrlShortener::new().unwrap();
    let short_url = us.generate(long_url, &Provider::IsGd);

    println!("{:?}", short_url);
}