Guest User

Untitled

a guest
Jan 21st, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.85 KB | None | 0 0
  1. warning: this `else { if .. }` block can be collapsed, #[warn(collapsible_if)] on by default
  2. --> src/protocol/binary.rs:98:16
  3. |
  4. 98 | } else {
  5. | ^
  6. |
  7. help: try
  8. | } else if self.strict {
  9. | // we're in strict mode however, and that always
  10. | // requires the protocol-version header to be written first
  11. | Err(::Error::Protocol(ProtocolError {
  12. | kind: ProtocolErrorKind::BadVersion,
  13. | message: format!("received bad version: {:?}", &first_bytes[0..2]),
  14. ...
  15. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#collapsible_if
  16.  
  17. warning: Consider removing unnecessary double parentheses, #[warn(double_parens)] on by default
  18. --> src/protocol/compact.rs:268:55
  19. |
  20. 268 | let val_type = try!(collection_u8_to_type((type_header & 0x0F)));
  21. | ^^^^^^^^^^^^^^^^^^^^
  22.  
  23. warning: you should put `TStoredInputProtocol` between ticks in the documentation, #[warn(doc_markdown)] on by default
  24. --> src/protocol/stored.rs:40:30
  25. |
  26. 40 | /// Constructing and using a TStoredInputProtocol
  27. | ^^^^^^^^^^^^^^^^^^^^
  28. |
  29. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#doc_markdown
  30.  
  31. warning: you should consider deriving a `Default` implementation for `protocol::binary::TBinaryInputProtocolFactory`, #[warn(new_without_default_derive)] on by default
  32. --> src/protocol/binary.rs:236:5
  33. |
  34. 236 | pub fn new() -> TBinaryInputProtocolFactory {
  35. | _____^ starting here...
  36. 237 | | TBinaryInputProtocolFactory {}
  37. 238 | | }
  38. | |_____^ ...ending here
  39. |
  40. help: try this
  41. | #[derive(Default)]
  42. | pub struct TBinaryInputProtocolFactory;
  43. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
  44.  
  45. warning: you should consider deriving a `Default` implementation for `protocol::binary::TBinaryOutputProtocolFactory`, #[warn(new_without_default_derive)] on by default
  46. --> src/protocol/binary.rs:433:5
  47. |
  48. 433 | pub fn new() -> TBinaryOutputProtocolFactory {
  49. | _____^ starting here...
  50. 434 | | TBinaryOutputProtocolFactory {}
  51. 435 | | }
  52. | |_____^ ...ending here
  53. |
  54. help: try this
  55. | #[derive(Default)]
  56. | pub struct TBinaryOutputProtocolFactory;
  57. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
  58.  
  59. warning: this `match` has identical arm bodies, #[warn(match_same_arms)] on by default
  60. --> src/protocol/binary.rs:455:24
  61. |
  62. 455 | TType::Utf7 => 0x0B,
  63. | ^^^^
  64. |
  65. note: same as this
  66. --> src/protocol/binary.rs:454:26
  67. |
  68. 454 | TType::String => 0x0B,
  69. | ^^^^
  70. note: consider refactoring into `TType::String | TType::Utf7`
  71. --> src/protocol/binary.rs:454:26
  72. |
  73. 454 | TType::String => 0x0B,
  74. | ^^^^
  75. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#match_same_arms
  76.  
  77. warning: you should consider deriving a `Default` implementation for `protocol::compact::TCompactInputProtocolFactory`, #[warn(new_without_default_derive)] on by default
  78. --> src/protocol/compact.rs:292:5
  79. |
  80. 292 | pub fn new() -> TCompactInputProtocolFactory {
  81. | _____^ starting here...
  82. 293 | | TCompactInputProtocolFactory {}
  83. 294 | | }
  84. | |_____^ ...ending here
  85. |
  86. help: try this
  87. | #[derive(Default)]
  88. | pub struct TCompactInputProtocolFactory;
  89. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
  90.  
  91. warning: you should consider deriving a `Default` implementation for `protocol::compact::TCompactOutputProtocolFactory`, #[warn(new_without_default_derive)] on by default
  92. --> src/protocol/compact.rs:543:5
  93. |
  94. 543 | pub fn new() -> TCompactOutputProtocolFactory {
  95. | _____^ starting here...
  96. 544 | | TCompactOutputProtocolFactory {}
  97. 545 | | }
  98. | |_____^ ...ending here
  99. |
  100. help: try this
  101. | #[derive(Default)]
  102. | pub struct TCompactOutputProtocolFactory;
  103. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
  104.  
  105. warning: this expression borrows a reference that is immediately dereferenced by the compiler, #[warn(needless_borrow)] on by default
  106. --> src/protocol/multiplexed.rs:76:49
  107. |
  108. 76 | _ => self.inner.write_message_begin(&identifier),
  109. | ^^^^^^^^^^^
  110. |
  111. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrow
  112.  
  113. warning: use of `ok_or` followed by a function call, #[warn(or_fun_call)] on by default
  114. --> src/protocol/stored.rs:97:9
  115. |
  116. 97 | self.message_ident.take().ok_or(::errors::new_protocol_error(ProtocolErrorKind::Unknown,
  117. | _________^ starting here...
  118. 98 | | "message identifier already \
  119. 99 | | read"))
  120. | |_____________________________________________________________________________^ ...ending here
  121. |
  122. help: try this
  123. | self.message_ident.take().ok_or_else(|| ::errors::new_protocol_error(ProtocolErrorKind::Unknown,
  124. | "message identifier already \
  125. | read"))
  126. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call
  127.  
  128. warning: use of `ok_or` followed by a function call, #[warn(or_fun_call)] on by default
  129. --> src/protocol/mod.rs:712:5
  130. |
  131. 712 | field_ident.id.ok_or(::Error::Protocol(::ProtocolError {
  132. | _____^ starting here...
  133. 713 | | kind: ::ProtocolErrorKind::Unknown,
  134. 714 | | message: format!("missing field in in {:?}", field_ident),
  135. 715 | | }))
  136. | |_______^ ...ending here
  137. |
  138. help: try this
  139. | field_ident.id.ok_or_else(|| ::Error::Protocol(::ProtocolError {
  140. | kind: ::ProtocolErrorKind::Unknown,
  141. | message: format!("missing field in in {:?}", field_ident),
  142. | }))
  143. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call
  144.  
  145. warning: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`, #[warn(single_match)] on by default
  146. --> src/server/simple.rs:150:13
  147. |
  148. 150 | match r {
  149. | _____________^ starting here...
  150. 151 | | Err(e) => {
  151. 152 | | warn!("processor failed with error: {:?}", e);
  152. 153 | | break; // FIXME: close here
  153. 154 | | }
  154. 155 | | Ok(_) => (),
  155. 156 | | }
  156. | |_____________^ ...ending here
  157. |
  158. help: try this
  159. | if let Err(e) = r {
  160. | warn!("processor failed with error: {:?}", e);
  161. | break; // FIXME: close here
  162. | }
  163. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#single_match
  164.  
  165. warning: usage of `contains_key` followed by `insert` on a `HashMap`, #[warn(map_entry)] on by default
  166. --> src/server/multiplexed.rs:45:9
  167. |
  168. 45 | if self.processors.contains_key(&name) {
  169. | _________^ starting here...
  170. 46 | | false
  171. 47 | | } else {
  172. 48 | | self.processors.insert(name, processor);
  173. 49 | | true
  174. 50 | | }
  175. | |_________^ ...ending here
  176. |
  177. help: consider using
  178. | self.processors.entry(name)
  179. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#map_entry
  180.  
  181. warning: you should consider deriving a `Default` implementation for `transport::buffered::TBufferedTransportFactory`, #[warn(new_without_default_derive)] on by default
  182. --> src/transport/buffered.rs:157:5
  183. |
  184. 157 | pub fn new() -> TBufferedTransportFactory {
  185. | _____^ starting here...
  186. 158 | | TBufferedTransportFactory {}
  187. 159 | | }
  188. | |_____^ ...ending here
  189. |
  190. help: try this
  191. | #[derive(Default)]
  192. | pub struct TBufferedTransportFactory;
  193. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
  194.  
  195. warning: this expression borrows a reference that is immediately dereferenced by the compiler, #[warn(needless_borrow)] on by default
  196. --> src/transport/framed.rs:136:69
  197. |
  198. 136 | self.wbuf[self.wpos..(self.wpos + nwrite)].clone_from_slice(&b);
  199. | ^^
  200. |
  201. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrow
  202.  
  203. warning: you should consider deriving a `Default` implementation for `transport::framed::TFramedTransportFactory`, #[warn(new_without_default_derive)] on by default
  204. --> src/transport/framed.rs:167:5
  205. |
  206. 167 | pub fn new() -> TFramedTransportFactory {
  207. | _____^ starting here...
  208. 168 | | TFramedTransportFactory {}
  209. 169 | | }
  210. | |_____^ ...ending here
  211. |
  212. help: try this
  213. | #[derive(Default)]
  214. | pub struct TFramedTransportFactory;
  215. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
  216.  
  217. warning: you should consider deriving a `Default` implementation for `transport::socket::TTcpTransport`, #[warn(new_without_default_derive)] on by default
  218. --> src/transport/socket.rs:69:5
  219. |
  220. 69 | pub fn new() -> TTcpTransport {
  221. | _____^ starting here...
  222. 70 | | TTcpTransport { stream: None }
  223. 71 | | }
  224. | |_____^ ...ending here
  225. |
  226. help: try this
  227. | #[derive(Default)]
  228. | pub struct TTcpTransport {
  229. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive
  230.  
  231. warning: redundant pattern matching, consider using `is_some()`, #[warn(if_let_redundant_pattern_matching)] on by default
  232. --> src/transport/socket.rs:81:16
  233. |
  234. 81 | if let Some(_) = self.stream {
  235. | ^^^^^^^
  236. |
  237. help: try this
  238. | if self.stream.is_some() {
  239. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#if_let_redundant_pattern_matching
  240.  
  241. warning: this expression borrows a reference that is immediately dereferenced by the compiler, #[warn(needless_borrow)] on by default
  242. --> src/errors.rs:272:68
  243. |
  244. 272 | Error::Transport(ref e) => TransportError::description(&e),
  245. | ^^
  246. |
  247. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrow
  248.  
  249. warning: this expression borrows a reference that is immediately dereferenced by the compiler, #[warn(needless_borrow)] on by default
  250. --> src/errors.rs:273:66
  251. |
  252. 273 | Error::Protocol(ref e) => ProtocolError::description(&e),
  253. | ^^
  254. |
  255. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrow
  256.  
  257. warning: this expression borrows a reference that is immediately dereferenced by the compiler, #[warn(needless_borrow)] on by default
  258. --> src/errors.rs:274:72
  259. |
  260. 274 | Error::Application(ref e) => ApplicationError::description(&e),
  261. | ^^
  262. |
  263. = help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_borrow
  264.  
  265. Finished dev [unoptimized + debuginfo] target(s) in 2.13 secs
Advertisement
Add Comment
Please, Sign In to add comment