clipboard-master 2.0.0

Simple utility crate to monitor clipboard changes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Magnet links downloader module
use std::process::Command;

#[inline(always)]
pub fn is_applicable<T: AsRef<str>>(text: T) -> bool {
    text.as_ref().starts_with("magnet:")
}

#[inline(always)]
pub fn run<T: AsRef<str>>(magnet_uri: T) {
    Command::new("powershell").arg("-NoProfile")
                              .arg("-c")
                              .arg(format!("start {}", magnet_uri.as_ref()))
                              .status()
                              .expect("Unable to start powershell");
}