From 0a8dd9a961ffd5cb92f43a1daec1346ffbc65f63 Mon Sep 17 00:00:00 2001 From: Raphael Nestler Date: Mon, 31 May 2021 15:31:49 +0200 Subject: [PATCH] Simplify example usage of Magnet struct --- README.md | 7 +------ src/lib.rs | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9759d3f..aafb4ed 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,7 @@ From a Magnet struct, you can generate a magnet string again hash_type: "sha1".to_string(), xt: "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed".to_string(), xl: 1234567890, - tr: - { - let mut tr_vec = Vec::new(); - tr_vec.push("https://example.com/".to_string()); - tr_vec - }, + tr: vec!["https://example.com/".to_string()], kt: "cool+stuff".to_string(), ws: String::new(), acceptable_source: String::new(), diff --git a/src/lib.rs b/src/lib.rs index 305b73b..6658eb9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,12 +78,7 @@ const MANIFEST_TOPIC_RE_STR: &str = r"mt=((\w+)[A-Za-z0-9!@#$%^:*<>,?/()_+=.{}\\ /// hash_type: "sha1".to_string(), /// xt: "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed".to_string(), /// xl: 1234567890, -/// tr: -/// { -/// let mut tr_vec = Vec::new(); -/// tr_vec.push("https://example.com/".to_string()); -/// tr_vec -/// }, +/// tr: vec!["https://example.com/".to_string()], /// kt: "cool+stuff".to_string(), /// ws: String::new(), /// acceptable_source: String::new(),