Browse code

Clippy!

Julio Biason authored on 04/06/2019 05:31:37
Showing 1 changed files

... ...
@@ -49,7 +49,7 @@ fn main() {
49 49
         .take_while(|record| record.id != top)
50 50
         .map(|record| { dump_record(&record); record })
51 51
         .fold(None, {|first, current| {
52
-            if let Some(_) = first {
52
+            if first.is_some() {
53 53
                 first
54 54
             } else {
55 55
                 Some(current.id)
... ...
@@ -80,7 +80,7 @@ fn get_top_favourite() -> String {
80 80
     }
81 81
 }
82 82
 
83
-fn dump_record(record: &Status) -> () {
83
+fn dump_record(record: &Status) {
84 84
     log::debug!("Retrieving record {}", record.id);
85 85
     log::debug!("Content: {:?}", record);
86 86
     create_structure(&record);
... ...
@@ -94,11 +94,11 @@ fn toot_dir(record: &Status) -> PathBuf {
94 94
         .join(&record.id)
95 95
 }
96 96
 
97
-fn create_structure(record: &Status) -> () {
97
+fn create_structure(record: &Status) {
98 98
     std::fs::create_dir_all(toot_dir(record)).expect("Failed to create the storage path");
99 99
 }
100 100
 
101
-fn save_content(record: &Status) -> () {
101
+fn save_content(record: &Status) {
102 102
     if let Ok(mut fp) = File::create(toot_dir(&record).join("toot.md")) {
103 103
         log::debug!("Saving content of {}..", record.id);
104 104
         fp.write_all(html2md::parse_html(&record.content).as_bytes())
... ...
@@ -106,7 +106,7 @@ fn save_content(record: &Status) -> () {
106 106
     }
107 107
 }
108 108
 
109
-fn save_attachments(record: &Status) -> () {
109
+fn save_attachments(record: &Status) {
110 110
     log::debug!("Saving attachments of {}...", record.id);
111 111
     let base_path = toot_dir(&record);
112 112
     record
... ...
@@ -115,7 +115,7 @@ fn save_attachments(record: &Status) -> () {
115 115
         .for_each(move |x| save_attachment(&x, &base_path));
116 116
 }
117 117
 
118
-fn save_attachment(attachment: &Attachment, base_path: &PathBuf) -> () {
118
+fn save_attachment(attachment: &Attachment, base_path: &PathBuf) {
119 119
     log::debug!("Saving attachment {}", attachment.url);
120 120
     let filename = base_path.join(get_attachment_filename(&attachment.url));
121 121
     log::debug!("Saving attachment to {:?}", filename);