Commit 28740e06fc
28740e06fcc4708e2e199a91cd57e64f832ed2d1
parent: ee6177330e
Unsigned
Valentin Brandl <vbrandl@riseup.net> · 2020-05-09 10:31 UTC
committer: <dkasak@termina.org.uk>
Fix some clippy lints
Layout: unified · split
src/lib.rs
−1
| @@ -13,7 +13,6 @@ mod server; |
| 13 | use std::cell::{Ref, RefCell, RefMut}; |
13 | use std::cell::{Ref, RefCell, RefMut}; |
| 14 | use std::collections::HashMap; |
14 | use std::collections::HashMap; |
| 15 | use std::rc::Rc; |
15 | use std::rc::Rc; |
| 16 | use tracing_subscriber; |
| |
| 17 | |
16 | |
| 18 | use weechat::{ |
17 | use weechat::{ |
| 19 | buffer::Buffer, |
18 | buffer::Buffer, |
src/render.rs
+1 −1
| @@ -108,7 +108,7 @@ trait HasUrlOrFile { |
| 108 | fn resolve_url(&self) -> &str { |
108 | fn resolve_url(&self) -> &str { |
| 109 | // the file is either encrypted or not encrypted so either `url` or `file` must |
109 | // the file is either encrypted or not encrypted so either `url` or `file` must |
| 110 | // exist and unwrapping will never panic |
110 | // exist and unwrapping will never panic |
| 111 | self.url().or(self.file()).unwrap() |
111 | self.url().or_else(|| self.file()).unwrap() |
| 112 | } |
112 | } |
| 113 | } |
113 | } |
| 114 | |
114 | |
src/room_buffer.rs
+1 −2
| @@ -75,7 +75,6 @@ impl BufferInputCallbackAsync for MatrixRoom { |
| 75 | c.send_message(&room_id, &input).await; |
75 | c.send_message(&room_id, &input).await; |
| 76 | } else { |
76 | } else { |
| 77 | buffer.print("Error not connected"); |
77 | buffer.print("Error not connected"); |
| 78 | return; |
| |
| 79 | } |
78 | } |
| 80 | } |
79 | } |
| 81 | } |
80 | } |
| @@ -173,7 +172,7 @@ impl RoomBuffer { |
| 173 | |
172 | |
| 174 | if room_name == "#" { |
173 | if room_name == "#" { |
| 175 | "##".to_owned() |
174 | "##".to_owned() |
| 176 | } else if room_name.starts_with("#") { |
175 | } else if room_name.starts_with('#') { |
| 177 | room_name |
176 | room_name |
| 178 | } else { |
177 | } else { |
| 179 | // TODO: only do this for non-direct chats |
178 | // TODO: only do this for non-direct chats |