From a9789a83424f5716e6887cbca091a609a56f27c9 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Wed, 12 May 2021 17:22:17 +0200 Subject: [PATCH] updated documentation --- README.md | 6 +++--- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8c92ffb..b46ed98 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ This is a simple wrapper for [youtube-dl](https://youtube-dl.org/) in rust. ```rust +use ytd_rs::{YoutubeDL, ResultType, Arg}; // youtube-dl arguments quietly run process and to format the output // one doesn't take any input and is an option, the other takes the desired output format as input let args = vec![Arg::new("--quiet"), Arg::new_with_arg("--output", "%(title).90s.%(ext)s")]; @@ -14,11 +15,10 @@ let download = ytd.download(); // check what the result is and print out the path to the download or the error match download.result_type() { - ResultType::SUCCESS => println!("Your download: {}", download.output_dir().to_string()); + ResultType::SUCCESS => println!("Your download: {}", download.output_dir().to_string_lossy()), ResultType::IOERROR | ResultType::FAILURE => - println!("Couldn't start download: {}", download.output()); + println!("Couldn't start download: {}", download.output()), }; - ``` diff --git a/src/lib.rs b/src/lib.rs index 6b9969d..3911867 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -84,7 +84,7 @@ impl Display for Arg { /// Structure that represents a youtube-dl task. /// -/// Every task needs a download location [`path`], a list of ['Arg'] that can be empty +/// Every task needs a download location, a list of ['Arg'] that can be empty /// and a ['link'] to the desired source. #[derive(Clone, Debug)] pub struct YoutubeDL {