Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2023
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 196.18 KB | None | 0 0
  1. warning: sodg v0.0.0 (/Users/l3r8y/IdeaProjects/sodg) ignoring invalid dependency `clippy` which is missing a lib target
  2. Checking memchr v2.5.0
  3. Checking futures-core v0.3.25
  4. Checking libc v0.2.137
  5. Checking futures-sink v0.3.25
  6. Checking futures-task v0.3.25
  7. Checking slab v0.4.7
  8. Checking futures-io v0.3.25
  9. Checking pin-project-lite v0.2.9
  10. Checking pin-utils v0.1.0
  11. Checking peresil v0.3.0
  12. Checking typed-arena v1.7.0
  13. Checking futures-channel v0.3.25
  14. Checking cfg-if v1.0.0
  15. Checking itoa v1.0.4
  16. Checking time-core v0.1.0
  17. Checking lazy_static v1.4.0
  18. Checking log v0.4.17
  19. Checking aho-corasick v0.7.19
  20. Checking sxd-document v0.3.2
  21. Checking serde v1.0.152
  22. Checking regex-syntax v0.6.28
  23. Checking atty v0.2.14
  24. Checking num_threads v0.1.6
  25. Checking futures-util v0.3.25
  26. Checking quick-error v1.2.3
  27. Checking colored v2.0.0
  28. Checking time v0.3.17
  29. Checking either v1.8.0
  30. Checking futures-timer v3.0.2
  31. Checking itertools v0.10.5
  32. Checking anyhow v1.0.69
  33. Checking hex v0.4.3
  34. Checking sxd-xpath v0.4.2
  35. Checking xml-builder v0.5.1
  36. Checking simple_logger v4.0.0
  37. Checking regex v1.7.1
  38. Checking futures-executor v0.3.25
  39. Checking bincode v1.3.3
  40. Checking futures v0.3.25
  41. Checking rstest v0.16.0
  42. Checking sodg v0.0.0 (/Users/l3r8y/IdeaProjects/sodg)
  43. error: using `pub use`
  44. --> src/lib.rs:73:1
  45. |
  46. 73 | pub use crate::alerts::Alert;
  47. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  48. |
  49. = help: move the exported item to a public module instead
  50. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pub_use
  51. note: the lint level is defined here
  52. --> src/lib.rs:40:9
  53. |
  54. 40 | #![deny(warnings)]
  55. | ^^^^^^^^
  56. = note: `#[deny(clippy::pub_use)]` implied by `#[deny(warnings)]`
  57.  
  58. error: using `pub use`
  59. --> src/lib.rs:75:1
  60. |
  61. 75 | pub use crate::hex::Hex;
  62. | ^^^^^^^^^^^^^^^^^^^^^^^^
  63. |
  64. = help: move the exported item to a public module instead
  65. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pub_use
  66.  
  67. error: using `pub use`
  68. --> src/lib.rs:76:1
  69. |
  70. 76 | pub use crate::script::Script;
  71. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  72. |
  73. = help: move the exported item to a public module instead
  74. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pub_use
  75.  
  76. error: found empty brackets on struct declaration
  77. --> src/lib.rs:147:21
  78. |
  79. 147 | pub struct DeadRelay {}
  80. | ^^^
  81. |
  82. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
  83. = note: `#[deny(clippy::empty_structs_with_brackets)]` implied by `#[deny(warnings)]`
  84. = help: remove the brackets
  85.  
  86. error: missing documentation for a module
  87. --> src/lib.rs:49:1
  88. |
  89. 49 | mod alerts;
  90. | ^^^^^^^^^^^
  91. |
  92. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  93. = note: `#[deny(clippy::missing_docs_in_private_items)]` implied by `#[deny(warnings)]`
  94.  
  95. error: missing `#[inline]` for a method
  96. --> src/alerts.rs:55:5
  97. |
  98. 55 | / pub fn alert_on(&mut self, a: Alert) {
  99. 56 | | self.alerts.push(a);
  100. 57 | | }
  101. | |_____^
  102. |
  103. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  104. = note: `#[deny(clippy::missing_inline_in_public_items)]` implied by `#[deny(warnings)]`
  105.  
  106. error: missing `#[inline]` for a method
  107. --> src/alerts.rs:60:5
  108. |
  109. 60 | / pub fn alerts_off(&mut self) {
  110. 61 | | self.alerts_active = false;
  111. 62 | | }
  112. | |_____^
  113. |
  114. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  115.  
  116. error: docs for function returning `Result` missing `# Errors` section
  117. --> src/alerts.rs:69:5
  118. |
  119. 69 | pub fn alerts_on(&mut self) -> Result<()> {
  120. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  121. |
  122. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  123. = note: `#[deny(clippy::missing_errors_doc)]` implied by `#[deny(warnings)]`
  124.  
  125. error: missing `#[inline]` for a method
  126. --> src/alerts.rs:69:5
  127. |
  128. 69 | / pub fn alerts_on(&mut self) -> Result<()> {
  129. 70 | | self.alerts_active = true;
  130. 71 | | self.validate(self.vertices.keys().cloned().collect())
  131. 72 | | }
  132. | |_____^
  133. |
  134. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  135.  
  136. error: missing `return` statement
  137. --> src/alerts.rs:71:9
  138. |
  139. 71 | self.validate(self.vertices.keys().cloned().collect())
  140. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.validate(self.vertices.keys().cloned().collect())`
  141. |
  142. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  143. = note: `#[deny(clippy::implicit_return)]` implied by `#[deny(warnings)]`
  144.  
  145. error: used `cloned` where `copied` could be used instead
  146. --> src/alerts.rs:71:44
  147. |
  148. 71 | self.validate(self.vertices.keys().cloned().collect())
  149. | ^^^^^^ help: try: `copied`
  150. |
  151. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied
  152. = note: `#[deny(clippy::cloned_instead_of_copied)]` implied by `#[deny(warnings)]`
  153.  
  154. error: docs for function returning `Result` missing `# Errors` section
  155. --> src/alerts.rs:77:5
  156. |
  157. 77 | pub fn validate(&self, vx: Vec<u32>) -> Result<()> {
  158. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  159. |
  160. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  161.  
  162. error: missing `#[inline]` for a method
  163. --> src/alerts.rs:77:5
  164. |
  165. 77 | / pub fn validate(&self, vx: Vec<u32>) -> Result<()> {
  166. 78 | | if self.alerts_active {
  167. 79 | | for a in self.alerts.iter() {
  168. 80 | | let msgs = a(self, vx.clone());
  169. ... |
  170. 86 | | Ok(())
  171. 87 | | }
  172. | |_____^
  173. |
  174. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  175.  
  176. error: missing `return` statement
  177. --> src/alerts.rs:86:9
  178. |
  179. 86 | Ok(())
  180. | ^^^^^^ help: add `return` as shown: `return Ok(())`
  181. |
  182. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  183.  
  184. error: this argument is passed by value, but not consumed in the function body
  185. --> src/alerts.rs:77:32
  186. |
  187. 77 | pub fn validate(&self, vx: Vec<u32>) -> Result<()> {
  188. | ^^^^^^^^
  189. |
  190. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
  191. = note: `#[deny(clippy::needless_pass_by_value)]` implied by `#[deny(warnings)]`
  192. help: consider changing the type to
  193. |
  194. 77 | pub fn validate(&self, vx: &[u32]) -> Result<()> {
  195. | ~~~~~~
  196. help: change `vx.clone()` to
  197. |
  198. 80 | let msgs = a(self, vx.to_owned());
  199. | ~~~~~~~~~~~~~
  200.  
  201. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  202. --> src/alerts.rs:79:22
  203. |
  204. 79 | for a in self.alerts.iter() {
  205. | ^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&self.alerts`
  206. |
  207. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  208. = note: `#[deny(clippy::explicit_iter_loop)]` implied by `#[deny(warnings)]`
  209.  
  210. error: missing documentation for a module
  211. --> src/lib.rs:50:1
  212. |
  213. 50 | mod clone;
  214. | ^^^^^^^^^^
  215. |
  216. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  217.  
  218. error: missing trait method provided by default: `clone_from`
  219. --> src/clone.rs:23:1
  220. |
  221. 23 | impl Clone for Sodg {
  222. | ^^^^^^^^^^^^^^^^^^^
  223. |
  224. help: implement the method
  225. --> /Users/l3r8y/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/clone.rs:132:5
  226. |
  227. 132 | / fn clone_from(&mut self, source: &Self)
  228. 133 | | where
  229. 134 | | Self: ~const Destruct,
  230. | |______________________________^
  231. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_trait_methods
  232. = note: `#[deny(clippy::missing_trait_methods)]` implied by `#[deny(warnings)]`
  233.  
  234. error: missing `#[inline]` for a method
  235. --> src/clone.rs:25:5
  236. |
  237. 25 | / fn clone(&self) -> Self {
  238. 26 | | Sodg {
  239. 27 | | vertices: self.vertices.clone(),
  240. 28 | | next_v: self.next_v,
  241. ... |
  242. 33 | | }
  243. 34 | | }
  244. | |_____^
  245. |
  246. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  247.  
  248. error: missing `return` statement
  249. --> src/clone.rs:26:9
  250. |
  251. 26 | / Sodg {
  252. 27 | | vertices: self.vertices.clone(),
  253. 28 | | next_v: self.next_v,
  254. 29 | | alerts: vec![],
  255. ... |
  256. 32 | | finds: self.finds.clone(),
  257. 33 | | }
  258. | |_________^
  259. |
  260. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  261. help: add `return` as shown
  262. |
  263. 26 ~ return Sodg {
  264. 27 + vertices: self.vertices.clone(),
  265. 28 + next_v: self.next_v,
  266. 29 + alerts: vec![],
  267. 30 + alerts_active: false,
  268. 31 + #[cfg(feature = "sober")]
  269. 32 + finds: self.finds.clone(),
  270. 33 + }
  271. |
  272.  
  273. error: unnecessary structure name repetition
  274. --> src/clone.rs:26:9
  275. |
  276. 26 | Sodg {
  277. | ^^^^ help: use the applicable keyword: `Self`
  278. |
  279. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  280. = note: `#[deny(clippy::use_self)]` implied by `#[deny(warnings)]`
  281.  
  282. error: missing documentation for a module
  283. --> src/lib.rs:51:1
  284. |
  285. 51 | mod ctors;
  286. | ^^^^^^^^^^
  287. |
  288. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  289.  
  290. error: this method could have a `#[must_use]` attribute
  291. --> src/ctors.rs:30:5
  292. |
  293. 30 | pub fn empty() -> Self {
  294. | ^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn empty() -> Self`
  295. |
  296. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  297. = note: `#[deny(clippy::must_use_candidate)]` implied by `#[deny(warnings)]`
  298.  
  299. error: docs for function which may panic missing `# Panics` section
  300. --> src/ctors.rs:30:5
  301. |
  302. 30 | pub fn empty() -> Self {
  303. | ^^^^^^^^^^^^^^^^^^^^^^
  304. |
  305. note: first possible panic found here
  306. --> src/ctors.rs:42:26
  307. |
  308. 42 | for e in g.vertices.get(v).unwrap().edges.iter() {
  309. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  310. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
  311. = note: `#[deny(clippy::missing_panics_doc)]` implied by `#[deny(warnings)]`
  312.  
  313. error: missing `#[inline]` for a method
  314. --> src/ctors.rs:30:5
  315. |
  316. 30 | / pub fn empty() -> Self {
  317. 31 | | let mut g = Sodg {
  318. 32 | | vertices: HashMap::new(),
  319. 33 | | next_v: 0,
  320. ... |
  321. 128 | | g
  322. 129 | | }
  323. | |_____^
  324. |
  325. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  326.  
  327. error: missing `return` statement
  328. --> src/ctors.rs:128:9
  329. |
  330. 128 | g
  331. | ^ help: add `return` as shown: `return g`
  332. |
  333. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  334.  
  335. error: unnecessary structure name repetition
  336. --> src/ctors.rs:31:21
  337. |
  338. 31 | let mut g = Sodg {
  339. | ^^^^ help: use the applicable keyword: `Self`
  340. |
  341. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  342.  
  343. error: missing `return` statement
  344. --> src/ctors.rs:48:13
  345. |
  346. 48 | errors
  347. | ^^^^^^ help: add `return` as shown: `return errors`
  348. |
  349. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  350.  
  351. error: `g` shadows a previous, unrelated binding
  352. --> src/ctors.rs:39:21
  353. |
  354. 39 | g.alert_on(|g, vx| {
  355. | ^
  356. |
  357. note: previous binding is here
  358. --> src/ctors.rs:31:13
  359. |
  360. 31 | let mut g = Sodg {
  361. | ^^^^^
  362. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
  363. = note: `#[deny(clippy::shadow_unrelated)]` implied by `#[deny(warnings)]`
  364.  
  365. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  366. --> src/ctors.rs:41:22
  367. |
  368. 41 | for v in vx.iter() {
  369. | ^^^^^^^^^ help: to write this more concisely, try: `&vx`
  370. |
  371. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  372.  
  373. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  374. --> src/ctors.rs:42:26
  375. |
  376. 42 | for e in g.vertices.get(v).unwrap().edges.iter() {
  377. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&g.vertices.get(v).unwrap().edges`
  378. |
  379. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  380.  
  381. error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  382. --> src/ctors.rs:42:26
  383. |
  384. 42 | for e in g.vertices.get(v).unwrap().edges.iter() {
  385. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&g.vertices[v]`
  386. |
  387. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
  388. = note: `#[deny(clippy::get_unwrap)]` implied by `#[deny(warnings)]`
  389.  
  390. error: used `unwrap()` on an `Option` value
  391. --> src/ctors.rs:42:26
  392. |
  393. 42 | for e in g.vertices.get(v).unwrap().edges.iter() {
  394. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  395. |
  396. = help: if this value is `None`, it will panic
  397. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  398. = note: `#[deny(clippy::unwrap_used)]` implied by `#[deny(warnings)]`
  399.  
  400. error: literal non-ASCII character detected
  401. --> src/ctors.rs:44:45
  402. |
  403. 44 | errors.push(format!("Edge ν{}.{} arrives to lost ν{}", v, e.a, e.to));
  404. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge \u{3bd}{}.{} arrives to lost \u{3bd}{}"`
  405. |
  406. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  407. = note: `#[deny(clippy::non_ascii_literal)]` implied by `#[deny(warnings)]`
  408.  
  409. error: missing `return` statement
  410. --> src/ctors.rs:59:13
  411. |
  412. 59 | errors
  413. | ^^^^^^ help: add `return` as shown: `return errors`
  414. |
  415. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  416.  
  417. error: `g` shadows a previous, unrelated binding
  418. --> src/ctors.rs:50:21
  419. |
  420. 50 | g.alert_on(|g, vx| {
  421. | ^
  422. |
  423. note: previous binding is here
  424. --> src/ctors.rs:31:13
  425. |
  426. 31 | let mut g = Sodg {
  427. | ^^^^^
  428. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
  429.  
  430. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  431. --> src/ctors.rs:52:22
  432. |
  433. 52 | for v in vx.iter() {
  434. | ^^^^^^^^^ help: to write this more concisely, try: `&vx`
  435. |
  436. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  437.  
  438. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  439. --> src/ctors.rs:53:26
  440. |
  441. 53 | for e in g.vertices.get(v).unwrap().edges.iter() {
  442. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&g.vertices.get(v).unwrap().edges`
  443. |
  444. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  445.  
  446. error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  447. --> src/ctors.rs:53:26
  448. |
  449. 53 | for e in g.vertices.get(v).unwrap().edges.iter() {
  450. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&g.vertices[v]`
  451. |
  452. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
  453.  
  454. error: used `unwrap()` on an `Option` value
  455. --> src/ctors.rs:53:26
  456. |
  457. 53 | for e in g.vertices.get(v).unwrap().edges.iter() {
  458. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  459. |
  460. = help: if this value is `None`, it will panic
  461. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  462.  
  463. error: literal non-ASCII character detected
  464. --> src/ctors.rs:55:45
  465. |
  466. 55 | errors.push(format!("Edge ν{}.{} arrives to ν{} (loop)", v, e.a, e.to));
  467. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge \u{3bd}{}.{} arrives to \u{3bd}{} (loop)"`
  468. |
  469. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  470.  
  471. error: missing `return` statement
  472. --> src/ctors.rs:70:13
  473. |
  474. 70 | errors
  475. | ^^^^^^ help: add `return` as shown: `return errors`
  476. |
  477. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  478.  
  479. error: `g` shadows a previous, unrelated binding
  480. --> src/ctors.rs:61:21
  481. |
  482. 61 | g.alert_on(|g, vx| {
  483. | ^
  484. |
  485. note: previous binding is here
  486. --> src/ctors.rs:31:13
  487. |
  488. 31 | let mut g = Sodg {
  489. | ^^^^^
  490. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
  491.  
  492. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  493. --> src/ctors.rs:63:22
  494. |
  495. 63 | for v in vx.iter() {
  496. | ^^^^^^^^^ help: to write this more concisely, try: `&vx`
  497. |
  498. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  499.  
  500. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  501. --> src/ctors.rs:64:26
  502. |
  503. 64 | for e in g.vertices.get(v).unwrap().edges.iter() {
  504. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&g.vertices.get(v).unwrap().edges`
  505. |
  506. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  507.  
  508. error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  509. --> src/ctors.rs:64:26
  510. |
  511. 64 | for e in g.vertices.get(v).unwrap().edges.iter() {
  512. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&g.vertices[v]`
  513. |
  514. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
  515.  
  516. error: used `unwrap()` on an `Option` value
  517. --> src/ctors.rs:64:26
  518. |
  519. 64 | for e in g.vertices.get(v).unwrap().edges.iter() {
  520. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  521. |
  522. = help: if this value is `None`, it will panic
  523. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  524.  
  525. error: literal non-ASCII character detected
  526. --> src/ctors.rs:66:45
  527. |
  528. 66 | errors.push(format!("Edge from ν{} to ν{} has empty label", v, e.to));
  529. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge from \u{3bd}{} to \u{3bd}{} has empty label"`
  530. |
  531. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  532.  
  533. error: missing `return` statement
  534. --> src/ctors.rs:84:13
  535. |
  536. 84 | errors
  537. | ^^^^^^ help: add `return` as shown: `return errors`
  538. |
  539. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  540.  
  541. error: `g` shadows a previous, unrelated binding
  542. --> src/ctors.rs:72:21
  543. |
  544. 72 | g.alert_on(|g, vx| {
  545. | ^
  546. |
  547. note: previous binding is here
  548. --> src/ctors.rs:31:13
  549. |
  550. 31 | let mut g = Sodg {
  551. | ^^^^^
  552. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
  553.  
  554. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  555. --> src/ctors.rs:74:22
  556. |
  557. 74 | for v in vx.iter() {
  558. | ^^^^^^^^^ help: to write this more concisely, try: `&vx`
  559. |
  560. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  561.  
  562. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  563. --> src/ctors.rs:75:26
  564. |
  565. 75 | for e in g.vertices.get(v).unwrap().edges.iter() {
  566. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&g.vertices.get(v).unwrap().edges`
  567. |
  568. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  569.  
  570. error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  571. --> src/ctors.rs:75:26
  572. |
  573. 75 | for e in g.vertices.get(v).unwrap().edges.iter() {
  574. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&g.vertices[v]`
  575. |
  576. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
  577.  
  578. error: used `unwrap()` on an `Option` value
  579. --> src/ctors.rs:75:26
  580. |
  581. 75 | for e in g.vertices.get(v).unwrap().edges.iter() {
  582. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  583. |
  584. = help: if this value is `None`, it will panic
  585. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  586.  
  587. error: literal non-ASCII character detected
  588. --> src/ctors.rs:78:29
  589. |
  590. 78 | ... "Edge ν{}.{} points to ν{}, which doesn't exist",
  591. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge \u{3bd}{}.{} points to \u{3bd}{}, which doesn't exist"`
  592. |
  593. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  594.  
  595. error: missing `return` statement
  596. --> src/ctors.rs:123:13
  597. |
  598. 123 | errors
  599. | ^^^^^^ help: add `return` as shown: `return errors`
  600. |
  601. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  602.  
  603. error: `g` shadows a previous, unrelated binding
  604. --> src/ctors.rs:86:21
  605. |
  606. 86 | g.alert_on(|g, vx| {
  607. | ^
  608. |
  609. note: previous binding is here
  610. --> src/ctors.rs:31:13
  611. |
  612. 31 | let mut g = Sodg {
  613. | ^^^^^
  614. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
  615.  
  616. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  617. --> src/ctors.rs:88:22
  618. |
  619. 88 | for v in vx.iter() {
  620. | ^^^^^^^^^ help: to write this more concisely, try: `&vx`
  621. |
  622. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  623.  
  624. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  625. --> src/ctors.rs:89:26
  626. |
  627. 89 | for e in g.vertices.get(v).unwrap().edges.iter() {
  628. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&g.vertices.get(v).unwrap().edges`
  629. |
  630. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  631.  
  632. error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  633. --> src/ctors.rs:89:26
  634. |
  635. 89 | for e in g.vertices.get(v).unwrap().edges.iter() {
  636. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&g.vertices[v]`
  637. |
  638. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
  639.  
  640. error: used `unwrap()` on an `Option` value
  641. --> src/ctors.rs:89:26
  642. |
  643. 89 | for e in g.vertices.get(v).unwrap().edges.iter() {
  644. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  645. |
  646. = help: if this value is `None`, it will panic
  647. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  648.  
  649. error: literal non-ASCII character detected
  650. --> src/ctors.rs:92:29
  651. |
  652. 92 | ... "Edge label from ν{} to ν{} is an empty string",
  653. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge label from \u{3bd}{} to \u{3bd}{} is an empty string"`
  654. |
  655. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  656.  
  657. error: literal non-ASCII character detected
  658. --> src/ctors.rs:98:29
  659. |
  660. 98 | ... "Edge label from ν{} to ν{} has prohibited spaces: '{}'",
  661. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge label from \u{3bd}{} to \u{3bd}{} has prohibited spaces: '{}'"`
  662. |
  663. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  664.  
  665. error: literal non-ASCII character detected
  666. --> src/ctors.rs:105:29
  667. |
  668. 105 | ... "Edge label from ν{} to ν{} has more than one slash: '{}'",
  669. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge label from \u{3bd}{} to \u{3bd}{} has more than one slash: '{}'"`
  670. |
  671. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  672.  
  673. error: indexing may panic
  674. --> src/ctors.rs:109:24
  675. |
  676. 109 | if parts[0].contains('.') {
  677. | ^^^^^^^^
  678. |
  679. = help: consider using `.get(n)` or `.get_mut(n)` instead
  680. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  681. = note: `#[deny(clippy::indexing_slicing)]` implied by `#[deny(warnings)]`
  682.  
  683. error: literal non-ASCII character detected
  684. --> src/ctors.rs:111:29
  685. |
  686. 111 | ... "Edge label from ν{} to ν{} has a dot inside the head part: '{}'",
  687. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge label from \u{3bd}{} to \u{3bd}{} has a dot inside the head part: '{}'"`
  688. |
  689. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  690.  
  691. error: indexing may panic
  692. --> src/ctors.rs:115:44
  693. |
  694. 115 | if parts.len() == 2 && parts[1].is_empty() {
  695. | ^^^^^^^^
  696. |
  697. = help: consider using `.get(n)` or `.get_mut(n)` instead
  698. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  699.  
  700. error: literal non-ASCII character detected
  701. --> src/ctors.rs:117:29
  702. |
  703. 117 | ... "Edge label from ν{} to ν{} has an empty tail part: '{}'",
  704. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Edge label from \u{3bd}{} to \u{3bd}{} has an empty tail part: '{}'"`
  705. |
  706. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  707.  
  708. error: missing documentation for a module
  709. --> src/lib.rs:52:1
  710. |
  711. 52 | mod debug;
  712. | ^^^^^^^^^^
  713. |
  714. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  715.  
  716. error: used import from `std` instead of `alloc`
  717. --> src/debug.rs:23:5
  718. |
  719. 23 | use std::fmt;
  720. | ^^^^^^^^
  721. |
  722. = help: consider importing the item from `alloc`
  723. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc
  724. = note: `#[deny(clippy::std_instead_of_alloc)]` implied by `#[deny(warnings)]`
  725.  
  726. error: used import from `std` instead of `core`
  727. --> src/debug.rs:24:16
  728. |
  729. 24 | use std::fmt::{Debug, Display, Formatter};
  730. | ^^^^^
  731. |
  732. = help: consider importing the item from `core`
  733. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  734. = note: `#[deny(clippy::std_instead_of_core)]` implied by `#[deny(warnings)]`
  735.  
  736. error: used import from `std` instead of `core`
  737. --> src/debug.rs:24:23
  738. |
  739. 24 | use std::fmt::{Debug, Display, Formatter};
  740. | ^^^^^^^
  741. |
  742. = help: consider importing the item from `core`
  743. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  744.  
  745. error: used import from `std` instead of `core`
  746. --> src/debug.rs:24:32
  747. |
  748. 24 | use std::fmt::{Debug, Display, Formatter};
  749. | ^^^^^^^^^
  750. |
  751. = help: consider importing the item from `core`
  752. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  753.  
  754. error: missing `#[inline]` for a method
  755. --> src/debug.rs:27:5
  756. |
  757. 27 | / fn fmt(&self, f: &mut Formatter) -> fmt::Result {
  758. 28 | | <&Sodg as Debug>::fmt(&self, f)
  759. 29 | | }
  760. | |_____^
  761. |
  762. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  763.  
  764. error: missing `return` statement
  765. --> src/debug.rs:28:9
  766. |
  767. 28 | <&Sodg as Debug>::fmt(&self, f)
  768. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return <&Sodg as Debug>::fmt(&self, f)`
  769. |
  770. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  771.  
  772. error: unnecessary structure name repetition
  773. --> src/debug.rs:28:11
  774. |
  775. 28 | <&Sodg as Debug>::fmt(&self, f)
  776. | ^^^^ help: use the applicable keyword: `Self`
  777. |
  778. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  779.  
  780. error: missing `#[inline]` for a method
  781. --> src/debug.rs:33:5
  782. |
  783. 33 | / fn fmt(&self, f: &mut Formatter) -> fmt::Result {
  784. 34 | | let mut lines = vec![];
  785. 35 | | for (i, v) in self.vertices.iter() {
  786. 36 | | let mut attrs = v
  787. ... |
  788. 46 | | f.write_str(lines.join("\n").as_str())
  789. 47 | | }
  790. | |_____^
  791. |
  792. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  793.  
  794. error: missing `return` statement
  795. --> src/debug.rs:46:9
  796. |
  797. 46 | f.write_str(lines.join("\n").as_str())
  798. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return f.write_str(lines.join("\n").as_str())`
  799. |
  800. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  801.  
  802. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  803. --> src/debug.rs:35:23
  804. |
  805. 35 | for (i, v) in self.vertices.iter() {
  806. | ^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&self.vertices`
  807. |
  808. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  809.  
  810. error: literal non-ASCII character detected
  811. --> src/debug.rs:39:34
  812. |
  813. 39 | .map(|e| format!("\n\t{} ➞ ν{}", e.a, e.to))
  814. | ^^^^^^^^^^^^^^ help: consider replacing the string with: `"\n\t{} \u{279e} \u{3bd}{}"`
  815. |
  816. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  817.  
  818. error: literal non-ASCII character detected
  819. --> src/debug.rs:44:32
  820. |
  821. 44 | lines.push(format!("ν{} -> ⟦{}⟧", i, attrs.join(", ")));
  822. | ^^^^^^^^^^^^^ help: consider replacing the string with: `"\u{3bd}{} -> \u{27e6}{}\u{27e7}"`
  823. |
  824. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  825.  
  826. error: this method could have a `#[must_use]` attribute
  827. --> src/debug.rs:53:5
  828. |
  829. 53 | pub fn v_print(&self, v: u32) -> String {
  830. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn v_print(&self, v: u32) -> String`
  831. |
  832. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  833.  
  834. error: docs for function which may panic missing `# Panics` section
  835. --> src/debug.rs:53:5
  836. |
  837. 53 | pub fn v_print(&self, v: u32) -> String {
  838. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  839. |
  840. note: first possible panic found here
  841. --> src/debug.rs:54:19
  842. |
  843. 54 | let vtx = self
  844. | ___________________^
  845. 55 | | .vertices
  846. 56 | | .get(&v)
  847. 57 | | .context(format!("Can't find ν{v}"))
  848. 58 | | .unwrap();
  849. | |_____________________^
  850. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
  851.  
  852. error: missing `#[inline]` for a method
  853. --> src/debug.rs:53:5
  854. |
  855. 53 | / pub fn v_print(&self, v: u32) -> String {
  856. 54 | | let vtx = self
  857. 55 | | .vertices
  858. 56 | | .get(&v)
  859. ... |
  860. 64 | | )
  861. 65 | | }
  862. | |_____^
  863. |
  864. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  865.  
  866. error: missing `return` statement
  867. --> src/debug.rs:60:9
  868. |
  869. 60 | / format!(
  870. 61 | | "ν{v}⟦{}{}⟧",
  871. 62 | | if vtx.data.is_empty() { "" } else { "Δ, " },
  872. 63 | | list.join(", ")
  873. 64 | | )
  874. | |_________^
  875. |
  876. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  877. help: add `return` as shown
  878. |
  879. 60 ~ return format!(
  880. 61 ~ "ν{v}⟦{}{}⟧",
  881. 62 ~ if vtx.data.is_empty() { "" } else { "Δ, " },
  882. 63 + list.join(", ")
  883. 64 + )
  884. |
  885.  
  886. error: used `unwrap()` on a `Result` value
  887. --> src/debug.rs:54:19
  888. |
  889. 54 | let vtx = self
  890. | ___________________^
  891. 55 | | .vertices
  892. 56 | | .get(&v)
  893. 57 | | .context(format!("Can't find ν{v}"))
  894. 58 | | .unwrap();
  895. | |_____________________^
  896. |
  897. = help: if this value is an `Err`, it will panic
  898. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  899.  
  900. error: literal non-ASCII character detected
  901. --> src/debug.rs:57:30
  902. |
  903. 57 | .context(format!("Can't find ν{v}"))
  904. | ^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't find \u{3bd}{v}"`
  905. |
  906. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  907.  
  908. error: missing `return` statement
  909. --> src/debug.rs:59:58
  910. |
  911. 59 | let list: Vec<String> = vtx.edges.iter().map(|e| e.a.clone()).collect();
  912. | ^^^^^^^^^^^ help: add `return` as shown: `return e.a.clone()`
  913. |
  914. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  915.  
  916. error: literal non-ASCII character detected
  917. --> src/debug.rs:61:13
  918. |
  919. 61 | "ν{v}⟦{}{}⟧",
  920. | ^^^^^^^^^^^^ help: consider replacing the string with: `"\u{3bd}{v}\u{27e6}{}{}\u{27e7}"`
  921. |
  922. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  923.  
  924. error: literal non-ASCII character detected
  925. --> src/debug.rs:62:50
  926. |
  927. 62 | if vtx.data.is_empty() { "" } else { "Δ, " },
  928. | ^^^^^ help: consider replacing the string with: `"\u{394}, "`
  929. |
  930. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  931.  
  932. error: missing documentation for a module
  933. --> src/lib.rs:53:1
  934. |
  935. 53 | mod dot;
  936. | ^^^^^^^^
  937. |
  938. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  939.  
  940. error: this method could have a `#[must_use]` attribute
  941. --> src/dot.rs:52:5
  942. |
  943. 52 | pub fn to_dot(&self) -> String {
  944. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn to_dot(&self) -> String`
  945. |
  946. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  947.  
  948. error: missing `#[inline]` for a method
  949. --> src/dot.rs:52:5
  950. |
  951. 52 | / pub fn to_dot(&self) -> String {
  952. 53 | | let mut lines: Vec<String> = vec![];
  953. 54 | | lines.push(
  954. 55 | | "/* Render it at https://dreampuf.github.io/GraphvizOnline/ */
  955. ... |
  956. 98 | | lines.join("\n")
  957. 99 | | }
  958. | |_____^
  959. |
  960. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  961.  
  962. error: missing `return` statement
  963. --> src/dot.rs:98:9
  964. |
  965. 98 | lines.join("\n")
  966. | ^^^^^^^^^^^^^^^^ help: add `return` as shown: `return lines.join("\n")`
  967. |
  968. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  969.  
  970. error: `to_string()` called on a `&str`
  971. --> src/dot.rs:55:13
  972. |
  973. 55 | / "/* Render it at https://dreampuf.github.io/GraphvizOnline/ */
  974. 56 | | digraph {
  975. 57 | | node [fixedsize=true,width=1,fontname=\"Arial\"];
  976. 58 | | edge [fontname=\"Arial\"];"
  977. 59 | | .to_string(),
  978. | |____________________________^
  979. |
  980. = help: consider using `.to_owned()`
  981. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  982. = note: `#[deny(clippy::str_to_string)]` implied by `#[deny(warnings)]`
  983.  
  984. error: missing `return` statement
  985. --> src/dot.rs:64:37
  986. |
  987. 64 | .sorted_by_key(|(v, _)| <&u32>::clone(v))
  988. | ^^^^^^^^^^^^^^^^ help: add `return` as shown: `return <&u32>::clone(v)`
  989. |
  990. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  991.  
  992. error: type of pattern does not match the expression type
  993. --> src/dot.rs:64:29
  994. |
  995. 64 | .sorted_by_key(|(v, _)| <&u32>::clone(v))
  996. | ^^^^^^
  997. |
  998. = help: explicitly match against a `&_` pattern and adjust the enclosed variable bindings
  999. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
  1000. = note: `#[deny(clippy::pattern_type_mismatch)]` implied by `#[deny(warnings)]`
  1001.  
  1002. error: literal non-ASCII character detected
  1003. --> src/dot.rs:67:17
  1004. |
  1005. 67 | " v{v}[shape=circle,label=\"ν{v}\"{}]; {}",
  1006. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `" v{v}[shape=circle,label=\"\u{3bd}{v}\"{}]; {}"`
  1007. |
  1008. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1009.  
  1010. error: `to_string()` called on a `&str`
  1011. --> src/dot.rs:74:21
  1012. |
  1013. 74 | "".to_string()
  1014. | ^^^^^^^^^^^^^^
  1015. |
  1016. = help: consider using `.to_owned()`
  1017. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  1018.  
  1019. error: empty String is being created manually
  1020. --> src/dot.rs:74:21
  1021. |
  1022. 74 | "".to_string()
  1023. | ^^^^^^^^^^^^^^ help: consider using: `String::new()`
  1024. |
  1025. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
  1026. = note: `#[deny(clippy::manual_string_new)]` implied by `#[deny(warnings)]`
  1027.  
  1028. error: missing `return` statement
  1029. --> src/dot.rs:79:57
  1030. |
  1031. 79 | for e in vtx.edges.iter().sorted_by_key(|e| e.a.clone()) {
  1032. | ^^^^^^^^^^^ help: add `return` as shown: `return e.a.clone()`
  1033. |
  1034. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1035.  
  1036. error: literal non-ASCII character detected
  1037. --> src/dot.rs:84:40
  1038. |
  1039. 84 | if e.a.starts_with('ρ') || e.a.starts_with('σ') {
  1040. | ^^^ help: consider replacing the string with: `'\u{3c1}'`
  1041. |
  1042. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1043.  
  1044. error: literal non-ASCII character detected
  1045. --> src/dot.rs:84:64
  1046. |
  1047. 84 | if e.a.starts_with('ρ') || e.a.starts_with('σ') {
  1048. | ^^^ help: consider replacing the string with: `'\u{3c3}'`
  1049. |
  1050. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1051.  
  1052. error: literal non-ASCII character detected
  1053. --> src/dot.rs:89:40
  1054. |
  1055. 89 | if e.a.starts_with('π') {
  1056. | ^^^ help: consider replacing the string with: `'\u{3c0}'`
  1057. |
  1058. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1059.  
  1060. error: `to_string()` called on a `&str`
  1061. --> src/dot.rs:97:20
  1062. |
  1063. 97 | lines.push("}\n".to_string());
  1064. | ^^^^^^^^^^^^^^^^^
  1065. |
  1066. = help: consider using `.to_owned()`
  1067. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  1068.  
  1069. error: missing documentation for a module
  1070. --> src/lib.rs:54:1
  1071. |
  1072. 54 | mod edge;
  1073. | ^^^^^^^^^
  1074. |
  1075. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1076.  
  1077. error: pub(crate) struct inside private module
  1078. --> src/edge.rs:25:1
  1079. |
  1080. 25 | pub(crate) struct Edge {
  1081. | ----------^^^^^^^^^^^^
  1082. | |
  1083. | help: consider using: `pub`
  1084. |
  1085. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate
  1086. = note: `#[deny(clippy::redundant_pub_crate)]` implied by `#[deny(warnings)]`
  1087.  
  1088. error: missing documentation for a struct field
  1089. --> src/edge.rs:26:5
  1090. |
  1091. 26 | pub to: u32,
  1092. | ^^^^^^^^^^^
  1093. |
  1094. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1095.  
  1096. error: missing documentation for a struct field
  1097. --> src/edge.rs:27:5
  1098. |
  1099. 27 | pub a: String,
  1100. | ^^^^^^^^^^^^^
  1101. |
  1102. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1103.  
  1104. error: missing documentation for an associated function
  1105. --> src/edge.rs:31:5
  1106. |
  1107. 31 | / pub fn new(to: u32, a: &str) -> Edge {
  1108. 32 | | Edge {
  1109. 33 | | to,
  1110. 34 | | a: a.to_string(),
  1111. 35 | | }
  1112. 36 | | }
  1113. | |_____^
  1114. |
  1115. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1116.  
  1117. error: missing `return` statement
  1118. --> src/edge.rs:32:9
  1119. |
  1120. 32 | / Edge {
  1121. 33 | | to,
  1122. 34 | | a: a.to_string(),
  1123. 35 | | }
  1124. | |_________^
  1125. |
  1126. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1127. help: add `return` as shown
  1128. |
  1129. 32 ~ return Edge {
  1130. 33 + to,
  1131. 34 + a: a.to_string(),
  1132. 35 + }
  1133. |
  1134.  
  1135. error: unnecessary structure name repetition
  1136. --> src/edge.rs:31:37
  1137. |
  1138. 31 | pub fn new(to: u32, a: &str) -> Edge {
  1139. | ^^^^ help: use the applicable keyword: `Self`
  1140. |
  1141. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1142.  
  1143. error: unnecessary structure name repetition
  1144. --> src/edge.rs:32:9
  1145. |
  1146. 32 | Edge {
  1147. | ^^^^ help: use the applicable keyword: `Self`
  1148. |
  1149. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1150.  
  1151. error: `to_string()` called on a `&str`
  1152. --> src/edge.rs:34:16
  1153. |
  1154. 34 | a: a.to_string(),
  1155. | ^^^^^^^^^^^^^
  1156. |
  1157. = help: consider using `.to_owned()`
  1158. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  1159.  
  1160. error: missing documentation for a module
  1161. --> src/lib.rs:55:1
  1162. |
  1163. 55 | mod find;
  1164. | ^^^^^^^^^
  1165. |
  1166. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1167.  
  1168. error: used import from `std` instead of `alloc`
  1169. --> src/find.rs:24:5
  1170. |
  1171. 24 | use std::collections::VecDeque;
  1172. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  1173. |
  1174. = help: consider importing the item from `alloc`
  1175. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc
  1176.  
  1177. error: used import from `std` instead of `core`
  1178. --> src/find.rs:25:5
  1179. |
  1180. 25 | use std::str::FromStr;
  1181. | ^^^^^^^^^^^^^^^^^
  1182. |
  1183. = help: consider importing the item from `core`
  1184. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  1185.  
  1186. error: missing `#[inline]` for a method
  1187. --> src/find.rs:28:5
  1188. |
  1189. 28 | / fn re(&self, _v: u32, _a: &str) -> Result<String> {
  1190. 29 | | Ok(self.s.clone())
  1191. 30 | | }
  1192. | |_____^
  1193. |
  1194. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1195.  
  1196. error: missing `return` statement
  1197. --> src/find.rs:29:9
  1198. |
  1199. 29 | Ok(self.s.clone())
  1200. | ^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(self.s.clone())`
  1201. |
  1202. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1203.  
  1204. error: this method could have a `#[must_use]` attribute
  1205. --> src/find.rs:35:5
  1206. |
  1207. 35 | pub fn new(s: &str) -> Self {
  1208. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(s: &str) -> Self`
  1209. |
  1210. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  1211.  
  1212. error: missing `#[inline]` for a method
  1213. --> src/find.rs:35:5
  1214. |
  1215. 35 | / pub fn new(s: &str) -> Self {
  1216. 36 | | ConstRelay { s: s.to_string() }
  1217. 37 | | }
  1218. | |_____^
  1219. |
  1220. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1221.  
  1222. error: missing `return` statement
  1223. --> src/find.rs:36:9
  1224. |
  1225. 36 | ConstRelay { s: s.to_string() }
  1226. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return ConstRelay { s: s.to_string() }`
  1227. |
  1228. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1229.  
  1230. error: unnecessary structure name repetition
  1231. --> src/find.rs:36:9
  1232. |
  1233. 36 | ConstRelay { s: s.to_string() }
  1234. | ^^^^^^^^^^ help: use the applicable keyword: `Self`
  1235. |
  1236. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1237.  
  1238. error: `to_string()` called on a `&str`
  1239. --> src/find.rs:36:25
  1240. |
  1241. 36 | ConstRelay { s: s.to_string() }
  1242. | ^^^^^^^^^^^^^
  1243. |
  1244. = help: consider using `.to_owned()`
  1245. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  1246.  
  1247. error: missing `#[inline]` for a method
  1248. --> src/find.rs:41:5
  1249. |
  1250. 41 | / fn re(&self, v: u32, a: &str) -> Result<String> {
  1251. 42 | | Err(anyhow!("Can't find ν{v}.{a}"))
  1252. 43 | | }
  1253. | |_____^
  1254. |
  1255. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1256.  
  1257. error: missing `return` statement
  1258. --> src/find.rs:42:9
  1259. |
  1260. 42 | Err(anyhow!("Can't find ν{v}.{a}"))
  1261. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Err(anyhow!("Can't find ν{v}.{a}"))`
  1262. |
  1263. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1264.  
  1265. error: literal non-ASCII character detected
  1266. --> src/find.rs:42:21
  1267. |
  1268. 42 | Err(anyhow!("Can't find ν{v}.{a}"))
  1269. | ^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't find \u{3bd}{v}.{a}"`
  1270. |
  1271. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1272.  
  1273. error: this method could have a `#[must_use]` attribute
  1274. --> src/find.rs:48:5
  1275. |
  1276. 48 | pub fn new() -> Self {
  1277. | ^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new() -> Self`
  1278. |
  1279. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  1280.  
  1281. error: missing `#[inline]` for a method
  1282. --> src/find.rs:48:5
  1283. |
  1284. 48 | / pub fn new() -> Self {
  1285. 49 | | DeadRelay {}
  1286. 50 | | }
  1287. | |_____^
  1288. |
  1289. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1290.  
  1291. error: missing `return` statement
  1292. --> src/find.rs:49:9
  1293. |
  1294. 49 | DeadRelay {}
  1295. | ^^^^^^^^^^^^ help: add `return` as shown: `return DeadRelay {}`
  1296. |
  1297. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1298.  
  1299. error: this could be a `const fn`
  1300. --> src/find.rs:48:5
  1301. |
  1302. 48 | / pub fn new() -> Self {
  1303. 49 | | DeadRelay {}
  1304. 50 | | }
  1305. | |_____^
  1306. |
  1307. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
  1308. = note: `#[deny(clippy::missing_const_for_fn)]` implied by `#[deny(warnings)]`
  1309.  
  1310. error: unnecessary structure name repetition
  1311. --> src/find.rs:49:9
  1312. |
  1313. 49 | DeadRelay {}
  1314. | ^^^^^^^^^ help: use the applicable keyword: `Self`
  1315. |
  1316. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1317.  
  1318. error: missing `#[inline]` for a method
  1319. --> src/find.rs:56:5
  1320. |
  1321. 56 | / fn default() -> Self {
  1322. 57 | | Self::new()
  1323. 58 | | }
  1324. | |_____^
  1325. |
  1326. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1327.  
  1328. error: missing `return` statement
  1329. --> src/find.rs:57:9
  1330. |
  1331. 57 | Self::new()
  1332. | ^^^^^^^^^^^ help: add `return` as shown: `return Self::new()`
  1333. |
  1334. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1335.  
  1336. error: missing `#[inline]` for a method
  1337. --> src/find.rs:74:5
  1338. |
  1339. 74 | / pub fn new(lambda: fn(u32, &str) -> Result<String>) -> Self {
  1340. 75 | | LambdaRelay { lambda }
  1341. 76 | | }
  1342. | |_____^
  1343. |
  1344. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1345.  
  1346. error: missing `return` statement
  1347. --> src/find.rs:75:9
  1348. |
  1349. 75 | LambdaRelay { lambda }
  1350. | ^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return LambdaRelay { lambda }`
  1351. |
  1352. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1353.  
  1354. error: unnecessary structure name repetition
  1355. --> src/find.rs:75:9
  1356. |
  1357. 75 | LambdaRelay { lambda }
  1358. | ^^^^^^^^^^^ help: use the applicable keyword: `Self`
  1359. |
  1360. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1361.  
  1362. error: missing `#[inline]` for a method
  1363. --> src/find.rs:80:5
  1364. |
  1365. 80 | / fn re(&self, v: u32, a: &str) -> Result<String> {
  1366. 81 | | (self.lambda)(v, a)
  1367. 82 | | }
  1368. | |_____^
  1369. |
  1370. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1371.  
  1372. error: missing `return` statement
  1373. --> src/find.rs:81:9
  1374. |
  1375. 81 | (self.lambda)(v, a)
  1376. | ^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return (self.lambda)(v, a)`
  1377. |
  1378. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1379.  
  1380. error: docs for function returning `Result` missing `# Errors` section
  1381. --> src/find.rs:112:5
  1382. |
  1383. 112 | pub fn find<T: Relay>(&self, v1: u32, loc: &str, relay: &T) -> Result<u32> {
  1384. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1385. |
  1386. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  1387.  
  1388. error: missing `#[inline]` for a method
  1389. --> src/find.rs:112:5
  1390. |
  1391. 112 | / pub fn find<T: Relay>(&self, v1: u32, loc: &str, relay: &T) -> Result<u32> {
  1392. 113 | | #[cfg(feature = "sober")]
  1393. 114 | | let badge = format!("ν{v1}.{loc}");
  1394. 115 | | #[cfg(feature = "sober")]
  1395. ... |
  1396. 136 | | v
  1397. 137 | | }
  1398. | |_____^
  1399. |
  1400. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1401.  
  1402. error: missing `return` statement
  1403. --> src/find.rs:136:9
  1404. |
  1405. 136 | v
  1406. | ^ help: add `return` as shown: `return v`
  1407. |
  1408. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1409.  
  1410. error: backticks are unbalanced
  1411. --> src/find.rs:141:5
  1412. |
  1413. 141 | /// This function is used only by [`Sodg::find].
  1414. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1415. |
  1416. = help: a backtick may be missing a pair
  1417. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
  1418. = note: `#[deny(clippy::doc_markdown)]` implied by `#[deny(warnings)]`
  1419.  
  1420. error: used unwrap or expect in a function that returns result or option
  1421. --> src/find.rs:142:5
  1422. |
  1423. 142 | / fn find_with_indent<T: Relay>(
  1424. 143 | | &self,
  1425. 144 | | v1: u32,
  1426. 145 | | loc: &str,
  1427. ... |
  1428. 217 | | Ok(v)
  1429. 218 | | }
  1430. | |_____^
  1431. |
  1432. = help: unwrap and expect should not be used in a function that returns result or option
  1433. note: potential non-recoverable error(s)
  1434. --> src/find.rs:174:21
  1435. |
  1436. 174 | let k = next.unwrap().to_string();
  1437. | ^^^^^^^^^^^^^
  1438. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result
  1439. = note: `#[deny(clippy::unwrap_in_result)]` implied by `#[deny(warnings)]`
  1440.  
  1441. error: missing `return` statement
  1442. --> src/find.rs:217:9
  1443. |
  1444. 217 | Ok(v)
  1445. | ^^^^^ help: add `return` as shown: `return Ok(v)`
  1446. |
  1447. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1448.  
  1449. error: default numeric fallback might occur
  1450. --> src/find.rs:161:25
  1451. |
  1452. 161 | let mut jumps = 0;
  1453. | ^ help: consider adding suffix: `0_i32`
  1454. |
  1455. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
  1456. = note: `#[deny(clippy::default_numeric_fallback)]` implied by `#[deny(warnings)]`
  1457.  
  1458. error: default numeric fallback might occur
  1459. --> src/find.rs:163:22
  1460. |
  1461. 163 | jumps += 1;
  1462. | ^ help: consider adding suffix: `1_i32`
  1463. |
  1464. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
  1465.  
  1466. error: missing `return` statement
  1467. --> src/find.rs:158:25
  1468. |
  1469. 158 | .filter(|k| !k.is_empty())
  1470. | ^^^^^^^^^^^^^ help: add `return` as shown: `return !k.is_empty()`
  1471. |
  1472. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1473.  
  1474. error: `to_string()` called on a `&str`
  1475. --> src/find.rs:159:45
  1476. |
  1477. 159 | .for_each(|k| locator.push_back(k.to_string()));
  1478. | ^^^^^^^^^^^^^
  1479. |
  1480. = help: consider using `.to_owned()`
  1481. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  1482.  
  1483. error: literal non-ASCII character detected
  1484. --> src/find.rs:160:22
  1485. |
  1486. 160 | let indent = "▷ ".repeat(depth);
  1487. | ^^^^ help: consider replacing the string with: `"\u{25b7} "`
  1488. |
  1489. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1490.  
  1491. error: arithmetic operation that can potentially result in unexpected side-effects
  1492. --> src/find.rs:163:13
  1493. |
  1494. 163 | jumps += 1;
  1495. | ^^^^^^^^^^
  1496. |
  1497. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  1498. = note: `#[deny(clippy::arithmetic_side_effects)]` implied by `#[deny(warnings)]`
  1499.  
  1500. error: integer arithmetic detected
  1501. --> src/find.rs:163:13
  1502. |
  1503. 163 | jumps += 1;
  1504. | ^^^^^^^^^^
  1505. |
  1506. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  1507. = note: `#[deny(clippy::integer_arithmetic)]` implied by `#[deny(warnings)]`
  1508.  
  1509. error: `to_string()` called on a `String`
  1510. --> src/find.rs:174:21
  1511. |
  1512. 174 | let k = next.unwrap().to_string();
  1513. | ^^^^^^^^^^^^^^^^^^^^^^^^^
  1514. |
  1515. = help: consider using `.clone()`
  1516. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_to_string
  1517. = note: `#[deny(clippy::string_to_string)]` implied by `#[deny(warnings)]`
  1518.  
  1519. error: used `unwrap()` on an `Option` value
  1520. --> src/find.rs:174:21
  1521. |
  1522. 174 | let k = next.unwrap().to_string();
  1523. | ^^^^^^^^^^^^^
  1524. |
  1525. = help: if this value is `None`, it will panic
  1526. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  1527.  
  1528. error: literal non-ASCII character detected
  1529. --> src/find.rs:184:30
  1530. |
  1531. 184 | if k.starts_with('ν') {
  1532. | ^^^ help: consider replacing the string with: `'\u{3bd}'`
  1533. |
  1534. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1535.  
  1536. error: `loc` shadows a previous, unrelated binding
  1537. --> src/find.rs:189:30
  1538. |
  1539. 189 | if let Some((to, loc)) = self.kid(v, k.as_str()) {
  1540. | ^^^
  1541. |
  1542. note: previous binding is here
  1543. --> src/find.rs:145:9
  1544. |
  1545. 145 | loc: &str,
  1546. | ^^^
  1547. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_unrelated
  1548.  
  1549. error: literal non-ASCII character detected
  1550. --> src/find.rs:195:20
  1551. |
  1552. 195 | trace!("#find(ν{v1}, {loc}): {indent}calling relay(ν{v}, {k})...");
  1553. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"#find(\u{3bd}{v1}, {loc}): {indent}calling relay(\u{3bd}{v}, {k})..."`
  1554. |
  1555. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1556.  
  1557. error: literal non-ASCII character detected
  1558. --> src/find.rs:195:13
  1559. |
  1560. 195 | trace!("#find(ν{v1}, {loc}): {indent}calling relay(ν{v}, {k})...");
  1561. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `trace!("#find(\u{3bd}{v1}, {loc}): {indent}calling relay(\u{3bd}{v}, {k})...")`
  1562. |
  1563. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1564.  
  1565. error: arithmetic operation that can potentially result in unexpected side-effects
  1566. --> src/find.rs:198:82
  1567. |
  1568. 198 | if let Ok(to) = self.find_with_indent(v, re.as_str(), relay, depth + 1) {
  1569. | ^^^^^^^^^
  1570. |
  1571. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  1572.  
  1573. error: integer arithmetic detected
  1574. --> src/find.rs:198:82
  1575. |
  1576. 198 | if let Ok(to) = self.find_with_indent(v, re.as_str(), relay, depth + 1) {
  1577. | ^^^^^^^^^
  1578. |
  1579. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  1580.  
  1581. error: literal non-ASCII character detected
  1582. --> src/find.rs:199:32
  1583. |
  1584. 199 | trace!("#find(ν{v1}, {loc}): {indent}ν{v}.{k} relayed to ν{to} (re: {re})");
  1585. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"#find(\u{3bd}{v1}, {loc}): {indent}\u{3bd}{v}.{k} relayed to \u{3bd}{to} (re: {re})"`
  1586. |
  1587. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1588.  
  1589. error: literal non-ASCII character detected
  1590. --> src/find.rs:199:25
  1591. |
  1592. 199 | trace!("#find(ν{v1}, {loc}): {indent}ν{v}.{k} relayed to ν{to} (re: {re})");
  1593. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `trace!("#find(\u{3bd}{v1}, {loc}): {indent}\u{3bd}{v}.{k} relayed to \u{3bd}{to} (re: {re})")`
  1594. |
  1595. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1596.  
  1597. error: literal non-ASCII character detected
  1598. --> src/find.rs:207:25
  1599. |
  1600. 207 | "#find(ν{v1}, {loc}): '{}' from relay of .{k} in {}",
  1601. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"#find(\u{3bd}{v1}, {loc}): '{}' from relay of .{k} in {}"`
  1602. |
  1603. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1604.  
  1605. error: literal non-ASCII character detected
  1606. --> src/find.rs:206:21
  1607. |
  1608. 206 | / trace!(
  1609. 207 | | "#find(ν{v1}, {loc}): '{}' from relay of .{k} in {}",
  1610. 208 | | err,
  1611. 209 | | self.v_print(v)
  1612. 210 | | );
  1613. | |_____________________^
  1614. |
  1615. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1616. help: consider replacing the string with
  1617. |
  1618. 206 ~ trace!(
  1619. 207 + "#find(\u{3bd}{v1}, {loc}): '{}' from relay of .{k} in {}",
  1620. 208 + err,
  1621. 209 + self.v_print(v)
  1622. 210 ~ );
  1623. |
  1624.  
  1625. error: literal non-ASCII character detected
  1626. --> src/find.rs:216:16
  1627. |
  1628. 216 | trace!("#find(ν{v1}, {loc}): {indent}found ν{v} in {jumps} jumps");
  1629. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"#find(\u{3bd}{v1}, {loc}): {indent}found \u{3bd}{v} in {jumps} jumps"`
  1630. |
  1631. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1632.  
  1633. error: literal non-ASCII character detected
  1634. --> src/find.rs:216:9
  1635. |
  1636. 216 | trace!("#find(ν{v1}, {loc}): {indent}found ν{v} in {jumps} jumps");
  1637. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `trace!("#find(\u{3bd}{v1}, {loc}): {indent}found \u{3bd}{v} in {jumps} jumps")`
  1638. |
  1639. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  1640.  
  1641. error: missing documentation for a module
  1642. --> src/lib.rs:56:1
  1643. |
  1644. 56 | mod gc;
  1645. | ^^^^^^^
  1646. |
  1647. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1648.  
  1649. error: missing documentation for a module
  1650. --> src/lib.rs:57:1
  1651. |
  1652. 57 | mod hex;
  1653. | ^^^^^^^^
  1654. |
  1655. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1656.  
  1657. error: used import from `std` instead of `core`
  1658. --> src/hex.rs:23:16
  1659. |
  1660. 23 | use std::fmt::{Debug, Display, Formatter};
  1661. | ^^^^^
  1662. |
  1663. = help: consider importing the item from `core`
  1664. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  1665.  
  1666. error: used import from `std` instead of `core`
  1667. --> src/hex.rs:23:23
  1668. |
  1669. 23 | use std::fmt::{Debug, Display, Formatter};
  1670. | ^^^^^^^
  1671. |
  1672. = help: consider importing the item from `core`
  1673. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  1674.  
  1675. error: used import from `std` instead of `core`
  1676. --> src/hex.rs:23:32
  1677. |
  1678. 23 | use std::fmt::{Debug, Display, Formatter};
  1679. | ^^^^^^^^^
  1680. |
  1681. = help: consider importing the item from `core`
  1682. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  1683.  
  1684. error: used import from `std` instead of `core`
  1685. --> src/hex.rs:24:5
  1686. |
  1687. 24 | use std::str::FromStr;
  1688. | ^^^^^^^^^^^^^^^^^
  1689. |
  1690. = help: consider importing the item from `core`
  1691. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  1692.  
  1693. error: exported enums should not be exhaustive
  1694. --> src/hex.rs:45:1
  1695. |
  1696. 45 | / pub enum Hex {
  1697. 46 | | Vector(Vec<u8>),
  1698. 47 | | Bytes([u8; 24], usize),
  1699. 48 | | }
  1700. | |_^
  1701. |
  1702. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#exhaustive_enums
  1703. = note: `#[deny(clippy::exhaustive_enums)]` implied by `#[deny(warnings)]`
  1704. help: try adding #[non_exhaustive]
  1705. |
  1706. 45 | #[non_exhaustive]
  1707. |
  1708.  
  1709. error: missing documentation for a variant
  1710. --> src/hex.rs:46:5
  1711. |
  1712. 46 | Vector(Vec<u8>),
  1713. | ^^^^^^^^^^^^^^^
  1714. |
  1715. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1716.  
  1717. error: missing documentation for a variant
  1718. --> src/hex.rs:47:5
  1719. |
  1720. 47 | Bytes([u8; 24], usize),
  1721. | ^^^^^^^^^^^^^^^^^^^^^^
  1722. |
  1723. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  1724.  
  1725. error: missing `#[inline]` for a method
  1726. --> src/hex.rs:51:5
  1727. |
  1728. 51 | / fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
  1729. 52 | | f.write_str(self.print().as_str())
  1730. 53 | | }
  1731. | |_____^
  1732. |
  1733. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1734.  
  1735. error: missing `return` statement
  1736. --> src/hex.rs:52:9
  1737. |
  1738. 52 | f.write_str(self.print().as_str())
  1739. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return f.write_str(self.print().as_str())`
  1740. |
  1741. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1742.  
  1743. error: used import from `std` instead of `core`
  1744. --> src/hex.rs:51:45
  1745. |
  1746. 51 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
  1747. | ^^^^^^^^^^^^^^^^
  1748. |
  1749. = help: consider importing the item from `core`
  1750. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  1751.  
  1752. error: missing trait method provided by default: `ne`
  1753. --> src/hex.rs:56:1
  1754. |
  1755. 56 | impl PartialEq for Hex {
  1756. | ^^^^^^^^^^^^^^^^^^^^^^
  1757. |
  1758. help: implement the method
  1759. --> /Users/l3r8y/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:229:5
  1760. |
  1761. 229 | fn ne(&self, other: &Rhs) -> bool {
  1762. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1763. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_trait_methods
  1764.  
  1765. error: missing `#[inline]` for a method
  1766. --> src/hex.rs:57:5
  1767. |
  1768. 57 | / fn eq(&self, other: &Self) -> bool {
  1769. 58 | | self.bytes() == other.bytes()
  1770. 59 | | }
  1771. | |_____^
  1772. |
  1773. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1774.  
  1775. error: missing `return` statement
  1776. --> src/hex.rs:58:9
  1777. |
  1778. 58 | self.bytes() == other.bytes()
  1779. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.bytes() == other.bytes()`
  1780. |
  1781. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1782.  
  1783. error: missing trait method provided by default: `assert_receiver_is_total_eq`
  1784. --> src/hex.rs:62:1
  1785. |
  1786. 62 | impl Eq for Hex {}
  1787. | ^^^^^^^^^^^^^^^
  1788. |
  1789. help: implement the method
  1790. --> /Users/l3r8y/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/cmp.rs:297:5
  1791. |
  1792. 297 | fn assert_receiver_is_total_eq(&self) {}
  1793. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1794. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_trait_methods
  1795.  
  1796. error: missing `#[inline]` for a method
  1797. --> src/hex.rs:65:5
  1798. |
  1799. 65 | / fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
  1800. 66 | | f.write_str(self.print().as_str())
  1801. 67 | | }
  1802. | |_____^
  1803. |
  1804. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1805.  
  1806. error: missing `return` statement
  1807. --> src/hex.rs:66:9
  1808. |
  1809. 66 | f.write_str(self.print().as_str())
  1810. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return f.write_str(self.print().as_str())`
  1811. |
  1812. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1813.  
  1814. error: used import from `std` instead of `core`
  1815. --> src/hex.rs:65:45
  1816. |
  1817. 65 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
  1818. | ^^^^^^^^^^^^^^^^
  1819. |
  1820. = help: consider importing the item from `core`
  1821. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  1822.  
  1823. error: this method could have a `#[must_use]` attribute
  1824. --> src/hex.rs:81:5
  1825. |
  1826. 81 | pub fn empty() -> Self {
  1827. | ^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn empty() -> Self`
  1828. |
  1829. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  1830.  
  1831. error: missing `#[inline]` for a method
  1832. --> src/hex.rs:81:5
  1833. |
  1834. 81 | / pub fn empty() -> Self {
  1835. 82 | | Self::from_vec(Vec::new())
  1836. 83 | | }
  1837. | |_____^
  1838. |
  1839. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1840.  
  1841. error: missing `return` statement
  1842. --> src/hex.rs:82:9
  1843. |
  1844. 82 | Self::from_vec(Vec::new())
  1845. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_vec(Vec::new())`
  1846. |
  1847. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1848.  
  1849. error: this method could have a `#[must_use]` attribute
  1850. --> src/hex.rs:94:5
  1851. |
  1852. 94 | pub fn bytes(&self) -> &[u8] {
  1853. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn bytes(&self) -> &[u8]`
  1854. |
  1855. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  1856.  
  1857. error: missing `#[inline]` for a method
  1858. --> src/hex.rs:94:5
  1859. |
  1860. 94 | / pub fn bytes(&self) -> &[u8] {
  1861. 95 | | match self {
  1862. 96 | | Hex::Vector(v) => v,
  1863. 97 | | Hex::Bytes(array, size) => &array[..*size],
  1864. 98 | | }
  1865. 99 | | }
  1866. | |_____^
  1867. |
  1868. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1869.  
  1870. error: missing `return` statement
  1871. --> src/hex.rs:96:31
  1872. |
  1873. 96 | Hex::Vector(v) => v,
  1874. | ^ help: add `return` as shown: `return v`
  1875. |
  1876. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1877.  
  1878. error: missing `return` statement
  1879. --> src/hex.rs:97:40
  1880. |
  1881. 97 | Hex::Bytes(array, size) => &array[..*size],
  1882. | ^^^^^^^^^^^^^^^ help: add `return` as shown: `return &array[..*size]`
  1883. |
  1884. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1885.  
  1886. error: type of pattern does not match the expression type
  1887. --> src/hex.rs:96:13
  1888. |
  1889. 96 | Hex::Vector(v) => v,
  1890. | ^^^^^^^^^^^^^^
  1891. |
  1892. = help: use `*` to dereference the match expression or explicitly match against a `&_` pattern and adjust the enclosed variable bindings
  1893. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
  1894.  
  1895. error: unnecessary structure name repetition
  1896. --> src/hex.rs:96:13
  1897. |
  1898. 96 | Hex::Vector(v) => v,
  1899. | ^^^ help: use the applicable keyword: `Self`
  1900. |
  1901. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1902.  
  1903. error: unnecessary structure name repetition
  1904. --> src/hex.rs:97:13
  1905. |
  1906. 97 | Hex::Bytes(array, size) => &array[..*size],
  1907. | ^^^ help: use the applicable keyword: `Self`
  1908. |
  1909. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1910.  
  1911. error: slicing may panic
  1912. --> src/hex.rs:97:41
  1913. |
  1914. 97 | Hex::Bytes(array, size) => &array[..*size],
  1915. | ^^^^^^^^^^^^^^
  1916. |
  1917. = help: consider using `.get(..n)`or `.get_mut(..n)` instead
  1918. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  1919.  
  1920. error: this method could have a `#[must_use]` attribute
  1921. --> src/hex.rs:118:5
  1922. |
  1923. 118 | pub fn len(&self) -> usize {
  1924. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn len(&self) -> usize`
  1925. |
  1926. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  1927.  
  1928. error: missing `#[inline]` for a method
  1929. --> src/hex.rs:118:5
  1930. |
  1931. 118 | / pub fn len(&self) -> usize {
  1932. 119 | | match self {
  1933. 120 | | Hex::Vector(x) => x.len(),
  1934. 121 | | Hex::Bytes(_, size) => *size,
  1935. 122 | | }
  1936. 123 | | }
  1937. | |_____^
  1938. |
  1939. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  1940.  
  1941. error: missing `return` statement
  1942. --> src/hex.rs:120:31
  1943. |
  1944. 120 | Hex::Vector(x) => x.len(),
  1945. | ^^^^^^^ help: add `return` as shown: `return x.len()`
  1946. |
  1947. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1948.  
  1949. error: missing `return` statement
  1950. --> src/hex.rs:121:36
  1951. |
  1952. 121 | Hex::Bytes(_, size) => *size,
  1953. | ^^^^^ help: add `return` as shown: `return *size`
  1954. |
  1955. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  1956.  
  1957. error: type of pattern does not match the expression type
  1958. --> src/hex.rs:120:13
  1959. |
  1960. 120 | Hex::Vector(x) => x.len(),
  1961. | ^^^^^^^^^^^^^^
  1962. |
  1963. = help: use `*` to dereference the match expression or explicitly match against a `&_` pattern and adjust the enclosed variable bindings
  1964. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
  1965.  
  1966. error: unnecessary structure name repetition
  1967. --> src/hex.rs:120:13
  1968. |
  1969. 120 | Hex::Vector(x) => x.len(),
  1970. | ^^^ help: use the applicable keyword: `Self`
  1971. |
  1972. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1973.  
  1974. error: unnecessary structure name repetition
  1975. --> src/hex.rs:121:13
  1976. |
  1977. 121 | Hex::Bytes(_, size) => *size,
  1978. | ^^^ help: use the applicable keyword: `Self`
  1979. |
  1980. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  1981.  
  1982. error: this method could have a `#[must_use]` attribute
  1983. --> src/hex.rs:136:5
  1984. |
  1985. 136 | pub fn from_slice(slice: &[u8]) -> Self {
  1986. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn from_slice(slice: &[u8]) -> Self`
  1987. |
  1988. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  1989.  
  1990. error: missing `#[inline]` for a method
  1991. --> src/hex.rs:136:5
  1992. |
  1993. 136 | / pub fn from_slice(slice: &[u8]) -> Self {
  1994. 137 | | if slice.len() <= 24 {
  1995. 138 | | Self::Bytes(
  1996. 139 | | {
  1997. ... |
  1998. 148 | | }
  1999. 149 | | }
  2000. | |_____^
  2001. |
  2002. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2003.  
  2004. error: missing `return` statement
  2005. --> src/hex.rs:138:13
  2006. |
  2007. 138 | / Self::Bytes(
  2008. 139 | | {
  2009. 140 | | let mut x = [0; 24];
  2010. 141 | | x[..slice.len()].copy_from_slice(slice);
  2011. ... |
  2012. 144 | | slice.len(),
  2013. 145 | | )
  2014. | |_____________^
  2015. |
  2016. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2017. help: add `return` as shown
  2018. |
  2019. 138 ~ return Self::Bytes(
  2020. 139 + {
  2021. 140 + let mut x = [0; 24];
  2022. 141 + x[..slice.len()].copy_from_slice(slice);
  2023. 142 + x
  2024. 143 + },
  2025. 144 + slice.len(),
  2026. 145 + )
  2027. |
  2028.  
  2029. error: missing `return` statement
  2030. --> src/hex.rs:147:13
  2031. |
  2032. 147 | Self::Vector(slice.to_vec())
  2033. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::Vector(slice.to_vec())`
  2034. |
  2035. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2036.  
  2037. error: slicing may panic
  2038. --> src/hex.rs:141:21
  2039. |
  2040. 141 | x[..slice.len()].copy_from_slice(slice);
  2041. | ^^^^^^^^^^^^^^^^
  2042. |
  2043. = help: consider using `.get(..n)`or `.get_mut(..n)` instead
  2044. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  2045.  
  2046. error: this method could have a `#[must_use]` attribute
  2047. --> src/hex.rs:160:5
  2048. |
  2049. 160 | pub fn from_vec(bytes: Vec<u8>) -> Self {
  2050. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn from_vec(bytes: Vec<u8>) -> Self`
  2051. |
  2052. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2053.  
  2054. error: missing `#[inline]` for a method
  2055. --> src/hex.rs:160:5
  2056. |
  2057. 160 | / pub fn from_vec(bytes: Vec<u8>) -> Self {
  2058. 161 | | if bytes.len() <= 24 {
  2059. 162 | | Self::from_slice(&bytes)
  2060. 163 | | } else {
  2061. 164 | | Self::Vector(bytes)
  2062. 165 | | }
  2063. 166 | | }
  2064. | |_____^
  2065. |
  2066. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2067.  
  2068. error: missing `return` statement
  2069. --> src/hex.rs:162:13
  2070. |
  2071. 162 | Self::from_slice(&bytes)
  2072. | ^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_slice(&bytes)`
  2073. |
  2074. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2075.  
  2076. error: missing `return` statement
  2077. --> src/hex.rs:164:13
  2078. |
  2079. 164 | Self::Vector(bytes)
  2080. | ^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::Vector(bytes)`
  2081. |
  2082. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2083.  
  2084. error: this method could have a `#[must_use]` attribute
  2085. --> src/hex.rs:177:5
  2086. |
  2087. 177 | pub fn from_string_bytes(d: String) -> Self {
  2088. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn from_string_bytes(d: String) -> Self`
  2089. |
  2090. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2091.  
  2092. error: missing `#[inline]` for a method
  2093. --> src/hex.rs:177:5
  2094. |
  2095. 177 | / pub fn from_string_bytes(d: String) -> Self {
  2096. 178 | | Self::from_slice(d.as_bytes())
  2097. 179 | | }
  2098. | |_____^
  2099. |
  2100. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2101.  
  2102. error: missing `return` statement
  2103. --> src/hex.rs:178:9
  2104. |
  2105. 178 | Self::from_slice(d.as_bytes())
  2106. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_slice(d.as_bytes())`
  2107. |
  2108. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2109.  
  2110. error: this argument is passed by value, but not consumed in the function body
  2111. --> src/hex.rs:177:33
  2112. |
  2113. 177 | pub fn from_string_bytes(d: String) -> Self {
  2114. | ^^^^^^ help: consider changing the type to: `&str`
  2115. |
  2116. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
  2117.  
  2118. error: this method could have a `#[must_use]` attribute
  2119. --> src/hex.rs:190:5
  2120. |
  2121. 190 | pub fn from_str_bytes(d: &str) -> Self {
  2122. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn from_str_bytes(d: &str) -> Self`
  2123. |
  2124. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2125.  
  2126. error: missing `#[inline]` for a method
  2127. --> src/hex.rs:190:5
  2128. |
  2129. 190 | / pub fn from_str_bytes(d: &str) -> Self {
  2130. 191 | | Self::from_slice(d.as_bytes())
  2131. 192 | | }
  2132. | |_____^
  2133. |
  2134. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2135.  
  2136. error: missing `return` statement
  2137. --> src/hex.rs:191:9
  2138. |
  2139. 191 | Self::from_slice(d.as_bytes())
  2140. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_slice(d.as_bytes())`
  2141. |
  2142. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2143.  
  2144. error: this method could have a `#[must_use]` attribute
  2145. --> src/hex.rs:203:5
  2146. |
  2147. 203 | pub fn is_empty(&self) -> bool {
  2148. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn is_empty(&self) -> bool`
  2149. |
  2150. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2151.  
  2152. error: missing `#[inline]` for a method
  2153. --> src/hex.rs:203:5
  2154. |
  2155. 203 | / pub fn is_empty(&self) -> bool {
  2156. 204 | | self.len() == 0
  2157. 205 | | }
  2158. | |_____^
  2159. |
  2160. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2161.  
  2162. error: missing `return` statement
  2163. --> src/hex.rs:204:9
  2164. |
  2165. 204 | self.len() == 0
  2166. | ^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.len() == 0`
  2167. |
  2168. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2169.  
  2170. error: docs for function returning `Result` missing `# Errors` section
  2171. --> src/hex.rs:216:5
  2172. |
  2173. 216 | pub fn to_bool(&self) -> Result<bool> {
  2174. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2175. |
  2176. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  2177.  
  2178. error: missing `#[inline]` for a method
  2179. --> src/hex.rs:216:5
  2180. |
  2181. 216 | / pub fn to_bool(&self) -> Result<bool> {
  2182. 217 | | Ok(self.bytes()[0] == 0x01)
  2183. 218 | | }
  2184. | |_____^
  2185. |
  2186. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2187.  
  2188. error: missing `return` statement
  2189. --> src/hex.rs:217:9
  2190. |
  2191. 217 | Ok(self.bytes()[0] == 0x01)
  2192. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(self.bytes()[0] == 0x01)`
  2193. |
  2194. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2195.  
  2196. error: indexing may panic
  2197. --> src/hex.rs:217:12
  2198. |
  2199. 217 | Ok(self.bytes()[0] == 0x01)
  2200. | ^^^^^^^^^^^^^^^
  2201. |
  2202. = help: consider using `.get(n)` or `.get_mut(n)` instead
  2203. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  2204.  
  2205. error: docs for function returning `Result` missing `# Errors` section
  2206. --> src/hex.rs:229:5
  2207. |
  2208. 229 | pub fn to_i64(&self) -> Result<i64> {
  2209. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2210. |
  2211. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  2212.  
  2213. error: missing `#[inline]` for a method
  2214. --> src/hex.rs:229:5
  2215. |
  2216. 229 | / pub fn to_i64(&self) -> Result<i64> {
  2217. 230 | | let a: &[u8; 8] = &self.bytes().try_into().context(format!(
  2218. 231 | | "There is not enough bytes, can't make INT (just {} while we need eight)",
  2219. 232 | | self.bytes().len()
  2220. 233 | | ))?;
  2221. 234 | | Ok(i64::from_be_bytes(*a))
  2222. 235 | | }
  2223. | |_____^
  2224. |
  2225. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2226.  
  2227. error: missing `return` statement
  2228. --> src/hex.rs:234:9
  2229. |
  2230. 234 | Ok(i64::from_be_bytes(*a))
  2231. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(i64::from_be_bytes(*a))`
  2232. |
  2233. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2234.  
  2235. error: docs for function returning `Result` missing `# Errors` section
  2236. --> src/hex.rs:246:5
  2237. |
  2238. 246 | pub fn to_f64(&self) -> Result<f64> {
  2239. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2240. |
  2241. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  2242.  
  2243. error: missing `#[inline]` for a method
  2244. --> src/hex.rs:246:5
  2245. |
  2246. 246 | / pub fn to_f64(&self) -> Result<f64> {
  2247. 247 | | let a: &[u8; 8] = &self.bytes().try_into().context(format!(
  2248. 248 | | "There is not enough bytes, can't make FLOAT (just {} while we need eight)",
  2249. 249 | | self.bytes().len()
  2250. 250 | | ))?;
  2251. 251 | | Ok(f64::from_be_bytes(*a))
  2252. 252 | | }
  2253. | |_____^
  2254. |
  2255. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2256.  
  2257. error: missing `return` statement
  2258. --> src/hex.rs:251:9
  2259. |
  2260. 251 | Ok(f64::from_be_bytes(*a))
  2261. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(f64::from_be_bytes(*a))`
  2262. |
  2263. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2264.  
  2265. error: docs for function returning `Result` missing `# Errors` section
  2266. --> src/hex.rs:263:5
  2267. |
  2268. 263 | pub fn to_utf8(&self) -> Result<String> {
  2269. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2270. |
  2271. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  2272.  
  2273. error: missing `#[inline]` for a method
  2274. --> src/hex.rs:263:5
  2275. |
  2276. 263 | / pub fn to_utf8(&self) -> Result<String> {
  2277. 264 | | String::from_utf8(self.bytes().to_vec()).context(format!(
  2278. 265 | | "The string inside Hex is not UTF-8 ({} bytes)",
  2279. 266 | | self.len()
  2280. 267 | | ))
  2281. 268 | | }
  2282. | |_____^
  2283. |
  2284. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2285.  
  2286. error: missing `return` statement
  2287. --> src/hex.rs:264:9
  2288. |
  2289. 264 | / String::from_utf8(self.bytes().to_vec()).context(format!(
  2290. 265 | | "The string inside Hex is not UTF-8 ({} bytes)",
  2291. 266 | | self.len()
  2292. 267 | | ))
  2293. | |__________^
  2294. |
  2295. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2296. help: add `return` as shown
  2297. |
  2298. 264 ~ return String::from_utf8(self.bytes().to_vec()).context(format!(
  2299. 265 + "The string inside Hex is not UTF-8 ({} bytes)",
  2300. 266 + self.len()
  2301. 267 + ))
  2302. |
  2303.  
  2304. error: this method could have a `#[must_use]` attribute
  2305. --> src/hex.rs:295:5
  2306. |
  2307. 295 | pub fn print(&self) -> String {
  2308. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn print(&self) -> String`
  2309. |
  2310. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2311.  
  2312. error: missing `#[inline]` for a method
  2313. --> src/hex.rs:295:5
  2314. |
  2315. 295 | / pub fn print(&self) -> String {
  2316. 296 | | if self.bytes().is_empty() {
  2317. 297 | | "--".to_string()
  2318. 298 | | } else {
  2319. ... |
  2320. 304 | | }
  2321. 305 | | }
  2322. | |_____^
  2323. |
  2324. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2325.  
  2326. error: missing `return` statement
  2327. --> src/hex.rs:297:13
  2328. |
  2329. 297 | "--".to_string()
  2330. | ^^^^^^^^^^^^^^^^ help: add `return` as shown: `return "--".to_string()`
  2331. |
  2332. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2333.  
  2334. error: missing `return` statement
  2335. --> src/hex.rs:299:13
  2336. |
  2337. 299 | / self.bytes()
  2338. 300 | | .iter()
  2339. 301 | | .map(|b| format!("{b:02X}"))
  2340. 302 | | .collect::<Vec<String>>()
  2341. 303 | | .join("-")
  2342. | |__________________________^
  2343. |
  2344. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2345. help: add `return` as shown
  2346. |
  2347. 299 ~ return self.bytes()
  2348. 300 + .iter()
  2349. 301 + .map(|b| format!("{b:02X}"))
  2350. 302 + .collect::<Vec<String>>()
  2351. 303 + .join("-")
  2352. |
  2353.  
  2354. error: `to_string()` called on a `&str`
  2355. --> src/hex.rs:297:13
  2356. |
  2357. 297 | "--".to_string()
  2358. | ^^^^^^^^^^^^^^^^
  2359. |
  2360. = help: consider using `.to_owned()`
  2361. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  2362.  
  2363. error: this method could have a `#[must_use]` attribute
  2364. --> src/hex.rs:308:5
  2365. |
  2366. 308 | pub fn to_vec(&self) -> Vec<u8> {
  2367. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn to_vec(&self) -> Vec<u8>`
  2368. |
  2369. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2370.  
  2371. error: missing `#[inline]` for a method
  2372. --> src/hex.rs:308:5
  2373. |
  2374. 308 | / pub fn to_vec(&self) -> Vec<u8> {
  2375. 309 | | self.bytes().to_vec()
  2376. 310 | | }
  2377. | |_____^
  2378. |
  2379. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2380.  
  2381. error: missing `return` statement
  2382. --> src/hex.rs:309:9
  2383. |
  2384. 309 | self.bytes().to_vec()
  2385. | ^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.bytes().to_vec()`
  2386. |
  2387. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2388.  
  2389. error: this method could have a `#[must_use]` attribute
  2390. --> src/hex.rs:322:5
  2391. |
  2392. 322 | pub fn byte_at(&self, pos: usize) -> u8 {
  2393. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn byte_at(&self, pos: usize) -> u8`
  2394. |
  2395. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2396.  
  2397. error: missing `#[inline]` for a method
  2398. --> src/hex.rs:322:5
  2399. |
  2400. 322 | / pub fn byte_at(&self, pos: usize) -> u8 {
  2401. 323 | | self.bytes()[pos]
  2402. 324 | | }
  2403. | |_____^
  2404. |
  2405. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2406.  
  2407. error: missing `return` statement
  2408. --> src/hex.rs:323:9
  2409. |
  2410. 323 | self.bytes()[pos]
  2411. | ^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.bytes()[pos]`
  2412. |
  2413. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2414.  
  2415. error: indexing may panic
  2416. --> src/hex.rs:323:9
  2417. |
  2418. 323 | self.bytes()[pos]
  2419. | ^^^^^^^^^^^^^^^^^
  2420. |
  2421. = help: consider using `.get(n)` or `.get_mut(n)` instead
  2422. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  2423.  
  2424. error: this method could have a `#[must_use]` attribute
  2425. --> src/hex.rs:336:5
  2426. |
  2427. 336 | pub fn tail(&self, skip: usize) -> Self {
  2428. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn tail(&self, skip: usize) -> Self`
  2429. |
  2430. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2431.  
  2432. error: missing `#[inline]` for a method
  2433. --> src/hex.rs:336:5
  2434. |
  2435. 336 | / pub fn tail(&self, skip: usize) -> Self {
  2436. 337 | | Self::from_vec(self.bytes()[skip..].to_vec())
  2437. 338 | | }
  2438. | |_____^
  2439. |
  2440. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2441.  
  2442. error: missing `return` statement
  2443. --> src/hex.rs:337:9
  2444. |
  2445. 337 | Self::from_vec(self.bytes()[skip..].to_vec())
  2446. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_vec(self.bytes()[skip..].to_vec())`
  2447. |
  2448. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2449.  
  2450. error: missing `#[must_use]` attribute on a method returning `Self`
  2451. --> src/hex.rs:336:5
  2452. |
  2453. 336 | / pub fn tail(&self, skip: usize) -> Self {
  2454. 337 | | Self::from_vec(self.bytes()[skip..].to_vec())
  2455. 338 | | }
  2456. | |_____^
  2457. |
  2458. = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
  2459. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
  2460. = note: `#[deny(clippy::return_self_not_must_use)]` implied by `#[deny(warnings)]`
  2461.  
  2462. error: slicing may panic
  2463. --> src/hex.rs:337:24
  2464. |
  2465. 337 | Self::from_vec(self.bytes()[skip..].to_vec())
  2466. | ^^^^^^^^^^^^^^^^^^^^
  2467. |
  2468. = help: consider using `.get(n..)` or .get_mut(n..)` instead
  2469. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  2470.  
  2471. error: this method could have a `#[must_use]` attribute
  2472. --> src/hex.rs:351:5
  2473. |
  2474. 351 | pub fn concat(&self, h: Self) -> Self {
  2475. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn concat(&self, h: Self) -> Self`
  2476. |
  2477. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2478.  
  2479. error: missing `#[inline]` for a method
  2480. --> src/hex.rs:351:5
  2481. |
  2482. 351 | / pub fn concat(&self, h: Self) -> Self {
  2483. 352 | | match &self {
  2484. 353 | | Hex::Vector(v) => {
  2485. 354 | | let mut vx = v.clone();
  2486. ... |
  2487. 370 | | }
  2488. 371 | | }
  2489. | |_____^
  2490. |
  2491. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2492.  
  2493. error: missing `return` statement
  2494. --> src/hex.rs:356:17
  2495. |
  2496. 356 | Hex::Vector(vx)
  2497. | ^^^^^^^^^^^^^^^ help: add `return` as shown: `return Hex::Vector(vx)`
  2498. |
  2499. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2500.  
  2501. error: missing `return` statement
  2502. --> src/hex.rs:362:21
  2503. |
  2504. 362 | Hex::Bytes(bytes, l + h.len())
  2505. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Hex::Bytes(bytes, l + h.len())`
  2506. |
  2507. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2508.  
  2509. error: missing `return` statement
  2510. --> src/hex.rs:367:21
  2511. |
  2512. 367 | Hex::Vector(v)
  2513. | ^^^^^^^^^^^^^^ help: add `return` as shown: `return Hex::Vector(v)`
  2514. |
  2515. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2516.  
  2517. error: this argument is passed by value, but not consumed in the function body
  2518. --> src/hex.rs:351:29
  2519. |
  2520. 351 | pub fn concat(&self, h: Self) -> Self {
  2521. | ^^^^ help: consider taking a reference instead: `&Self`
  2522. |
  2523. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
  2524.  
  2525. error: missing `#[must_use]` attribute on a method returning `Self`
  2526. --> src/hex.rs:351:5
  2527. |
  2528. 351 | / pub fn concat(&self, h: Self) -> Self {
  2529. 352 | | match &self {
  2530. 353 | | Hex::Vector(v) => {
  2531. 354 | | let mut vx = v.clone();
  2532. ... |
  2533. 370 | | }
  2534. 371 | | }
  2535. | |_____^
  2536. |
  2537. = help: consider adding the `#[must_use]` attribute to the method or directly to the `Self` type
  2538. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
  2539.  
  2540. error: type of pattern does not match the expression type
  2541. --> src/hex.rs:353:13
  2542. |
  2543. 353 | Hex::Vector(v) => {
  2544. | ^^^^^^^^^^^^^^
  2545. |
  2546. = help: use `*` to dereference the match expression or explicitly match against a `&_` pattern and adjust the enclosed variable bindings
  2547. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
  2548.  
  2549. error: unnecessary structure name repetition
  2550. --> src/hex.rs:353:13
  2551. |
  2552. 353 | Hex::Vector(v) => {
  2553. | ^^^ help: use the applicable keyword: `Self`
  2554. |
  2555. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  2556.  
  2557. error: unnecessary structure name repetition
  2558. --> src/hex.rs:356:17
  2559. |
  2560. 356 | Hex::Vector(vx)
  2561. | ^^^ help: use the applicable keyword: `Self`
  2562. |
  2563. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  2564.  
  2565. error: unnecessary structure name repetition
  2566. --> src/hex.rs:358:13
  2567. |
  2568. 358 | Hex::Bytes(b, l) => {
  2569. | ^^^ help: use the applicable keyword: `Self`
  2570. |
  2571. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  2572.  
  2573. error: arithmetic operation that can potentially result in unexpected side-effects
  2574. --> src/hex.rs:359:20
  2575. |
  2576. 359 | if l + h.len() <= 24 {
  2577. | ^^^^^^^^^^^
  2578. |
  2579. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  2580.  
  2581. error: integer arithmetic detected
  2582. --> src/hex.rs:359:20
  2583. |
  2584. 359 | if l + h.len() <= 24 {
  2585. | ^^^^^^^^^^^
  2586. |
  2587. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  2588.  
  2589. error: slicing may panic
  2590. --> src/hex.rs:361:21
  2591. |
  2592. 361 | bytes[*l..*l + h.len()].copy_from_slice(h.bytes());
  2593. | ^^^^^^^^^^^^^^^^^^^^^^^
  2594. |
  2595. = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
  2596. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  2597.  
  2598. error: arithmetic operation that can potentially result in unexpected side-effects
  2599. --> src/hex.rs:361:31
  2600. |
  2601. 361 | bytes[*l..*l + h.len()].copy_from_slice(h.bytes());
  2602. | ^^^^^^^^^^^^
  2603. |
  2604. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  2605.  
  2606. error: integer arithmetic detected
  2607. --> src/hex.rs:361:31
  2608. |
  2609. 361 | bytes[*l..*l + h.len()].copy_from_slice(h.bytes());
  2610. | ^^^^^^^^^^^^
  2611. |
  2612. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  2613.  
  2614. error: unnecessary structure name repetition
  2615. --> src/hex.rs:362:21
  2616. |
  2617. 362 | Hex::Bytes(bytes, l + h.len())
  2618. | ^^^ help: use the applicable keyword: `Self`
  2619. |
  2620. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  2621.  
  2622. error: arithmetic operation that can potentially result in unexpected side-effects
  2623. --> src/hex.rs:362:39
  2624. |
  2625. 362 | Hex::Bytes(bytes, l + h.len())
  2626. | ^^^^^^^^^^^
  2627. |
  2628. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  2629.  
  2630. error: integer arithmetic detected
  2631. --> src/hex.rs:362:39
  2632. |
  2633. 362 | Hex::Bytes(bytes, l + h.len())
  2634. | ^^^^^^^^^^^
  2635. |
  2636. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  2637.  
  2638. error: unnecessary structure name repetition
  2639. --> src/hex.rs:367:21
  2640. |
  2641. 367 | Hex::Vector(v)
  2642. | ^^^ help: use the applicable keyword: `Self`
  2643. |
  2644. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  2645.  
  2646. error: missing `#[inline]` for a method
  2647. --> src/hex.rs:384:5
  2648. |
  2649. 384 | / fn from(d: i64) -> Self {
  2650. 385 | | Self::from_slice(&d.to_be_bytes())
  2651. 386 | | }
  2652. | |_____^
  2653. |
  2654. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2655.  
  2656. error: missing `return` statement
  2657. --> src/hex.rs:385:9
  2658. |
  2659. 385 | Self::from_slice(&d.to_be_bytes())
  2660. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_slice(&d.to_be_bytes())`
  2661. |
  2662. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2663.  
  2664. error: missing `#[inline]` for a method
  2665. --> src/hex.rs:400:5
  2666. |
  2667. 400 | / fn from(d: f64) -> Self {
  2668. 401 | | Self::from_slice(&d.to_be_bytes())
  2669. 402 | | }
  2670. | |_____^
  2671. |
  2672. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2673.  
  2674. error: missing `return` statement
  2675. --> src/hex.rs:401:9
  2676. |
  2677. 401 | Self::from_slice(&d.to_be_bytes())
  2678. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_slice(&d.to_be_bytes())`
  2679. |
  2680. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2681.  
  2682. error: missing `#[inline]` for a method
  2683. --> src/hex.rs:415:5
  2684. |
  2685. 415 | / fn from(d: bool) -> Self {
  2686. 416 | | Self::from_slice(&(if d { [1] } else { [0] }))
  2687. 417 | | }
  2688. | |_____^
  2689. |
  2690. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2691.  
  2692. error: missing `return` statement
  2693. --> src/hex.rs:416:9
  2694. |
  2695. 416 | Self::from_slice(&(if d { [1] } else { [0] }))
  2696. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::from_slice(&(if d { [1] } else { [0] }))`
  2697. |
  2698. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2699.  
  2700. error: missing `#[inline]` for a method
  2701. --> src/hex.rs:448:5
  2702. |
  2703. 448 | / fn from_str(hex: &str) -> std::result::Result<Self, Self::Err> {
  2704. 449 | | let s = hex.replace('-', "");
  2705. 450 | | Ok(Self::from_vec(hex::decode(s)?))
  2706. 451 | | }
  2707. | |_____^
  2708. |
  2709. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2710.  
  2711. error: missing `return` statement
  2712. --> src/hex.rs:450:9
  2713. |
  2714. 450 | Ok(Self::from_vec(hex::decode(s)?))
  2715. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(Self::from_vec(hex::decode(s)?))`
  2716. |
  2717. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2718.  
  2719. error: used import from `std` instead of `core`
  2720. --> src/hex.rs:448:31
  2721. |
  2722. 448 | fn from_str(hex: &str) -> std::result::Result<Self, Self::Err> {
  2723. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2724. |
  2725. = help: consider importing the item from `core`
  2726. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  2727.  
  2728. error: missing documentation for a module
  2729. --> src/lib.rs:58:1
  2730. |
  2731. 58 | mod inspect;
  2732. | ^^^^^^^^^^^^
  2733. |
  2734. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  2735.  
  2736. error: docs for function returning `Result` missing `# Errors` section
  2737. --> src/inspect.rs:32:5
  2738. |
  2739. 32 | pub fn inspect(&self, loc: &str) -> Result<String> {
  2740. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2741. |
  2742. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  2743.  
  2744. error: missing `#[inline]` for a method
  2745. --> src/inspect.rs:32:5
  2746. |
  2747. 32 | / pub fn inspect(&self, loc: &str) -> Result<String> {
  2748. 33 | | let v = self
  2749. 34 | | .find(0, loc, &DeadRelay::default())
  2750. 35 | | .context(format!("Can't locate '{loc}'"))?;
  2751. ... |
  2752. 42 | | ))
  2753. 43 | | }
  2754. | |_____^
  2755. |
  2756. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2757.  
  2758. error: missing `return` statement
  2759. --> src/inspect.rs:37:9
  2760. |
  2761. 37 | / Ok(format!(
  2762. 38 | | "{}/ν{}\n{}",
  2763. 39 | | loc,
  2764. 40 | | v,
  2765. 41 | | self.inspect_v(v, &mut seen)?.join("\n")
  2766. 42 | | ))
  2767. | |__________^
  2768. |
  2769. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2770. help: add `return` as shown
  2771. |
  2772. 37 ~ return Ok(format!(
  2773. 38 ~ "{}/ν{}\n{}",
  2774. 39 + loc,
  2775. 40 + v,
  2776. 41 + self.inspect_v(v, &mut seen)?.join("\n")
  2777. 42 + ))
  2778. |
  2779.  
  2780. error: literal non-ASCII character detected
  2781. --> src/inspect.rs:38:13
  2782. |
  2783. 38 | "{}/ν{}\n{}",
  2784. | ^^^^^^^^^^^^ help: consider replacing the string with: `"{}/\u{3bd}{}\n{}"`
  2785. |
  2786. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  2787.  
  2788. error: missing documentation for an associated function
  2789. --> src/inspect.rs:45:5
  2790. |
  2791. 45 | / fn inspect_v(&self, v: u32, seen: &mut HashSet<u32>) -> Result<Vec<String>> {
  2792. 46 | | seen.insert(v);
  2793. 47 | | let mut lines = vec![];
  2794. 48 | | self.vertices
  2795. ... |
  2796. 75 | | Ok(lines)
  2797. 76 | | }
  2798. | |_____^
  2799. |
  2800. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  2801.  
  2802. error: missing `return` statement
  2803. --> src/inspect.rs:75:9
  2804. |
  2805. 75 | Ok(lines)
  2806. | ^^^^^^^^^ help: add `return` as shown: `return Ok(lines)`
  2807. |
  2808. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2809.  
  2810. error: literal non-ASCII character detected
  2811. --> src/inspect.rs:50:30
  2812. |
  2813. 50 | .context(format!("Can't find ν{v}"))?
  2814. | ^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't find \u{3bd}{v}"`
  2815. |
  2816. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  2817.  
  2818. error: literal non-ASCII character detected
  2819. --> src/inspect.rs:57:21
  2820. |
  2821. 57 | " .{} ➞ ν{}{}",
  2822. | ^^^^^^^^^^^^^^^ help: consider replacing the string with: `" .{} \u{279e} \u{3bd}{}{}"`
  2823. |
  2824. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  2825.  
  2826. error: `to_string()` called on a `&str`
  2827. --> src/inspect.rs:61:25
  2828. |
  2829. 61 | "…".to_string()
  2830. | ^^^^^^^^^^^^^^^
  2831. |
  2832. = help: consider using `.to_owned()`
  2833. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  2834.  
  2835. error: literal non-ASCII character detected
  2836. --> src/inspect.rs:61:25
  2837. |
  2838. 61 | "…".to_string()
  2839. | ^^^ help: consider replacing the string with: `"\u{2026}"`
  2840. |
  2841. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  2842.  
  2843. error: `to_string()` called on a `&str`
  2844. --> src/inspect.rs:63:25
  2845. |
  2846. 63 | "".to_string()
  2847. | ^^^^^^^^^^^^^^
  2848. |
  2849. = help: consider using `.to_owned()`
  2850. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  2851.  
  2852. error: empty String is being created manually
  2853. --> src/inspect.rs:63:25
  2854. |
  2855. 63 | "".to_string()
  2856. | ^^^^^^^^^^^^^^ help: consider using: `String::new()`
  2857. |
  2858. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_string_new
  2859.  
  2860. error: used `unwrap()` on a `Result` value
  2861. --> src/inspect.rs:69:21
  2862. |
  2863. 69 | / self.inspect_v(e.to, seen)
  2864. 70 | | .unwrap()
  2865. | |_________________________________^
  2866. |
  2867. = help: if this value is an `Err`, it will panic
  2868. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  2869.  
  2870. error: missing documentation for a module
  2871. --> src/lib.rs:59:1
  2872. |
  2873. 59 | mod merge;
  2874. | ^^^^^^^^^^
  2875. |
  2876. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  2877.  
  2878. error: docs for function returning `Result` missing `# Errors` section
  2879. --> src/merge.rs:32:5
  2880. |
  2881. 32 | pub fn merge(&mut self, g: &Sodg, left: u32, right: u32) -> Result<()> {
  2882. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2883. |
  2884. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  2885.  
  2886. error: missing `#[inline]` for a method
  2887. --> src/merge.rs:32:5
  2888. |
  2889. 32 | / pub fn merge(&mut self, g: &Sodg, left: u32, right: u32) -> Result<()> {
  2890. 33 | | let mut mapped = HashMap::new();
  2891. 34 | | let before = self.vertices.len();
  2892. 35 | | self.merge_rec(g, left, right, &mut mapped)?;
  2893. ... |
  2894. 48 | | Ok(())
  2895. 49 | | }
  2896. | |_____^
  2897. |
  2898. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  2899.  
  2900. error: missing `return` statement
  2901. --> src/merge.rs:48:9
  2902. |
  2903. 48 | Ok(())
  2904. | ^^^^^^ help: add `return` as shown: `return Ok(())`
  2905. |
  2906. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2907.  
  2908. error: unnecessary structure name repetition
  2909. --> src/merge.rs:32:33
  2910. |
  2911. 32 | pub fn merge(&mut self, g: &Sodg, left: u32, right: u32) -> Result<()> {
  2912. | ^^^^ help: use the applicable keyword: `Self`
  2913. |
  2914. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  2915.  
  2916. error: used unwrap or expect in a function that returns result or option
  2917. --> src/merge.rs:52:5
  2918. |
  2919. 52 | / fn merge_rec(
  2920. 53 | | &mut self,
  2921. 54 | | g: &Sodg,
  2922. 55 | | left: u32,
  2923. ... |
  2924. 79 | | Ok(())
  2925. 80 | | }
  2926. | |_____^
  2927. |
  2928. = help: unwrap and expect should not be used in a function that returns result or option
  2929. note: potential non-recoverable error(s)
  2930. --> src/merge.rs:63:24
  2931. |
  2932. 63 | self.put(left, g.vertices.get(&right).unwrap().data.clone())?;
  2933. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2934. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result
  2935.  
  2936. error: missing `return` statement
  2937. --> src/merge.rs:79:9
  2938. |
  2939. 79 | Ok(())
  2940. | ^^^^^^ help: add `return` as shown: `return Ok(())`
  2941. |
  2942. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  2943.  
  2944. error: unnecessary structure name repetition
  2945. --> src/merge.rs:54:13
  2946. |
  2947. 54 | g: &Sodg,
  2948. | ^^^^ help: use the applicable keyword: `Self`
  2949. |
  2950. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  2951.  
  2952. error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  2953. --> src/merge.rs:63:24
  2954. |
  2955. 63 | self.put(left, g.vertices.get(&right).unwrap().data.clone())?;
  2956. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&g.vertices[&right]`
  2957. |
  2958. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
  2959.  
  2960. error: used `unwrap()` on an `Option` value
  2961. --> src/merge.rs:63:24
  2962. |
  2963. 63 | self.put(left, g.vertices.get(&right).unwrap().data.clone())?;
  2964. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2965. |
  2966. = help: if this value is `None`, it will panic
  2967. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  2968.  
  2969. error: consider adding a `;` to the last statement for consistent formatting
  2970. --> src/merge.rs:77:13
  2971. |
  2972. 77 | self.merge_rec(g, target, to, mapped)?
  2973. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.merge_rec(g, target, to, mapped)?;`
  2974. |
  2975. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
  2976. = note: `#[deny(clippy::semicolon_if_nothing_returned)]` implied by `#[deny(warnings)]`
  2977.  
  2978. error: missing documentation for a module
  2979. --> src/lib.rs:60:1
  2980. |
  2981. 60 | mod misc;
  2982. | ^^^^^^^^^
  2983. |
  2984. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  2985.  
  2986. error: this method could have a `#[must_use]` attribute
  2987. --> src/misc.rs:25:5
  2988. |
  2989. 25 | pub fn len(&self) -> usize {
  2990. | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn len(&self) -> usize`
  2991. |
  2992. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  2993.  
  2994. error: missing `#[inline]` for a method
  2995. --> src/misc.rs:25:5
  2996. |
  2997. 25 | / pub fn len(&self) -> usize {
  2998. 26 | | self.vertices.len()
  2999. 27 | | }
  3000. | |_____^
  3001. |
  3002. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3003.  
  3004. error: missing `return` statement
  3005. --> src/misc.rs:26:9
  3006. |
  3007. 26 | self.vertices.len()
  3008. | ^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.vertices.len()`
  3009. |
  3010. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3011.  
  3012. error: this method could have a `#[must_use]` attribute
  3013. --> src/misc.rs:42:5
  3014. |
  3015. 42 | pub fn is_empty(&self) -> bool {
  3016. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn is_empty(&self) -> bool`
  3017. |
  3018. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  3019.  
  3020. error: missing `#[inline]` for a method
  3021. --> src/misc.rs:42:5
  3022. |
  3023. 42 | / pub fn is_empty(&self) -> bool {
  3024. 43 | | self.vertices.is_empty()
  3025. 44 | | }
  3026. | |_____^
  3027. |
  3028. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3029.  
  3030. error: missing `return` statement
  3031. --> src/misc.rs:43:9
  3032. |
  3033. 43 | self.vertices.is_empty()
  3034. | ^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.vertices.is_empty()`
  3035. |
  3036. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3037.  
  3038. error: missing documentation for a module
  3039. --> src/lib.rs:61:1
  3040. |
  3041. 61 | mod next;
  3042. | ^^^^^^^^^
  3043. |
  3044. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  3045.  
  3046. error: missing `#[inline]` for a method
  3047. --> src/next.rs:28:5
  3048. |
  3049. 28 | / pub fn next_id(&mut self) -> u32 {
  3050. 29 | | let mut id = self.next_v;
  3051. 30 | | for v in self.vertices.keys() {
  3052. 31 | | if *v >= id {
  3053. ... |
  3054. 36 | | id
  3055. 37 | | }
  3056. | |_____^
  3057. |
  3058. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3059.  
  3060. error: missing `return` statement
  3061. --> src/next.rs:36:9
  3062. |
  3063. 36 | id
  3064. | ^^ help: add `return` as shown: `return id`
  3065. |
  3066. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3067.  
  3068. error: arithmetic operation that can potentially result in unexpected side-effects
  3069. --> src/next.rs:32:22
  3070. |
  3071. 32 | id = *v + 1;
  3072. | ^^^^^^
  3073. |
  3074. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  3075.  
  3076. error: integer arithmetic detected
  3077. --> src/next.rs:32:22
  3078. |
  3079. 32 | id = *v + 1;
  3080. | ^^^^^^
  3081. |
  3082. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  3083.  
  3084. error: arithmetic operation that can potentially result in unexpected side-effects
  3085. --> src/next.rs:35:23
  3086. |
  3087. 35 | self.next_v = id + 1;
  3088. | ^^^^^^
  3089. |
  3090. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  3091.  
  3092. error: integer arithmetic detected
  3093. --> src/next.rs:35:23
  3094. |
  3095. 35 | self.next_v = id + 1;
  3096. | ^^^^^^
  3097. |
  3098. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  3099.  
  3100. error: missing documentation for a module
  3101. --> src/lib.rs:62:1
  3102. |
  3103. 62 | mod ops;
  3104. | ^^^^^^^^
  3105. |
  3106. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  3107.  
  3108. error: docs for function returning `Result` missing `# Errors` section
  3109. --> src/ops.rs:43:5
  3110. |
  3111. 43 | pub fn add(&mut self, v1: u32) -> Result<()> {
  3112. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3113. |
  3114. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  3115.  
  3116. error: missing `#[inline]` for a method
  3117. --> src/ops.rs:43:5
  3118. |
  3119. 43 | / pub fn add(&mut self, v1: u32) -> Result<()> {
  3120. 44 | | if self.vertices.contains_key(&v1) {
  3121. 45 | | return Ok(());
  3122. 46 | | }
  3123. ... |
  3124. 50 | | Ok(())
  3125. 51 | | }
  3126. | |_____^
  3127. |
  3128. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3129.  
  3130. error: missing `return` statement
  3131. --> src/ops.rs:50:9
  3132. |
  3133. 50 | Ok(())
  3134. | ^^^^^^ help: add `return` as shown: `return Ok(())`
  3135. |
  3136. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3137.  
  3138. error: literal non-ASCII character detected
  3139. --> src/ops.rs:49:16
  3140. |
  3141. 49 | trace!("#add(ν{}): new vertex added", v1);
  3142. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"#add(\u{3bd}{}): new vertex added"`
  3143. |
  3144. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3145.  
  3146. error: literal non-ASCII character detected
  3147. --> src/ops.rs:49:9
  3148. |
  3149. 49 | trace!("#add(ν{}): new vertex added", v1);
  3150. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `trace!("#add(\u{3bd}{}): new vertex added", v1)`
  3151. |
  3152. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3153.  
  3154. error: docs for function returning `Result` missing `# Errors` section
  3155. --> src/ops.rs:73:5
  3156. |
  3157. 73 | pub fn bind(&mut self, v1: u32, v2: u32, a: &str) -> Result<()> {
  3158. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3159. |
  3160. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  3161.  
  3162. error: missing `#[inline]` for a method
  3163. --> src/ops.rs:73:5
  3164. |
  3165. 73 | / pub fn bind(&mut self, v1: u32, v2: u32, a: &str) -> Result<()> {
  3166. 74 | | let vtx1 = self
  3167. 75 | | .vertices
  3168. 76 | | .get_mut(&v1)
  3169. ... |
  3170. 88 | | Ok(())
  3171. 89 | | }
  3172. | |_____^
  3173. |
  3174. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3175.  
  3176. error: missing `return` statement
  3177. --> src/ops.rs:88:9
  3178. |
  3179. 88 | Ok(())
  3180. | ^^^^^^ help: add `return` as shown: `return Ok(())`
  3181. |
  3182. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3183.  
  3184. error: literal non-ASCII character detected
  3185. --> src/ops.rs:77:30
  3186. |
  3187. 77 | .context(format!("Can't depart from ν{v1}, it's absent"))?;
  3188. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't depart from \u{3bd}{v1}, it's absent"`
  3189. |
  3190. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3191.  
  3192. error: missing `return` statement
  3193. --> src/ops.rs:79:25
  3194. |
  3195. 79 | .retain(|e| Self::split_a(&e.a).0 != Self::split_a(a).0);
  3196. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::split_a(&e.a).0 != Self::split_a(a).0`
  3197. |
  3198. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3199.  
  3200. error: literal non-ASCII character detected
  3201. --> src/ops.rs:84:30
  3202. |
  3203. 84 | .context(format!("Can't arrive at ν{v2}, it's absent"))?;
  3204. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't arrive at \u{3bd}{v2}, it's absent"`
  3205. |
  3206. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3207.  
  3208. error: literal non-ASCII character detected
  3209. --> src/ops.rs:87:16
  3210. |
  3211. 87 | trace!("#bind: edge added ν{}.{} → ν{}", v1, a, v2);
  3212. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"#bind: edge added \u{3bd}{}.{} \u{2192} \u{3bd}{}"`
  3213. |
  3214. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3215.  
  3216. error: literal non-ASCII character detected
  3217. --> src/ops.rs:87:9
  3218. |
  3219. 87 | trace!("#bind: edge added ν{}.{} → ν{}", v1, a, v2);
  3220. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `trace!("#bind: edge added \u{3bd}{}.{} \u{2192} \u{3bd}{}", v1, a, v2)`
  3221. |
  3222. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3223.  
  3224. error: docs for function returning `Result` missing `# Errors` section
  3225. --> src/ops.rs:104:5
  3226. |
  3227. 104 | pub fn put(&mut self, v: u32, d: Hex) -> Result<()> {
  3228. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3229. |
  3230. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  3231.  
  3232. error: missing `#[inline]` for a method
  3233. --> src/ops.rs:104:5
  3234. |
  3235. 104 | / pub fn put(&mut self, v: u32, d: Hex) -> Result<()> {
  3236. 105 | | let vtx = self
  3237. 106 | | .vertices
  3238. 107 | | .get_mut(&v)
  3239. ... |
  3240. 112 | | Ok(())
  3241. 113 | | }
  3242. | |_____^
  3243. |
  3244. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3245.  
  3246. error: missing `return` statement
  3247. --> src/ops.rs:112:9
  3248. |
  3249. 112 | Ok(())
  3250. | ^^^^^^ help: add `return` as shown: `return Ok(())`
  3251. |
  3252. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3253.  
  3254. error: this argument is passed by value, but not consumed in the function body
  3255. --> src/ops.rs:104:38
  3256. |
  3257. 104 | pub fn put(&mut self, v: u32, d: Hex) -> Result<()> {
  3258. | ^^^ help: consider taking a reference instead: `&Hex`
  3259. |
  3260. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
  3261.  
  3262. error: literal non-ASCII character detected
  3263. --> src/ops.rs:108:30
  3264. |
  3265. 108 | .context(format!("Can't find ν{v}"))?;
  3266. | ^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't find \u{3bd}{v}"`
  3267. |
  3268. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3269.  
  3270. error: literal non-ASCII character detected
  3271. --> src/ops.rs:111:16
  3272. |
  3273. 111 | trace!("#data: data of ν{v} set to {d}");
  3274. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"#data: data of \u{3bd}{v} set to {d}"`
  3275. |
  3276. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3277.  
  3278. error: literal non-ASCII character detected
  3279. --> src/ops.rs:111:9
  3280. |
  3281. 111 | trace!("#data: data of ν{v} set to {d}");
  3282. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `trace!("#data: data of \u{3bd}{v} set to {d}")`
  3283. |
  3284. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3285.  
  3286. error: docs for function returning `Result` missing `# Errors` section
  3287. --> src/ops.rs:141:5
  3288. |
  3289. 141 | pub fn data(&mut self, v: u32) -> Result<Hex> {
  3290. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3291. |
  3292. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  3293.  
  3294. error: missing `#[inline]` for a method
  3295. --> src/ops.rs:141:5
  3296. |
  3297. 141 | / pub fn data(&mut self, v: u32) -> Result<Hex> {
  3298. 142 | | let vtx = self
  3299. 143 | | .vertices
  3300. 144 | | .get_mut(&v)
  3301. ... |
  3302. 150 | | Ok(data)
  3303. 151 | | }
  3304. | |_____^
  3305. |
  3306. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3307.  
  3308. error: missing `return` statement
  3309. --> src/ops.rs:150:9
  3310. |
  3311. 150 | Ok(data)
  3312. | ^^^^^^^^ help: add `return` as shown: `return Ok(data)`
  3313. |
  3314. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3315.  
  3316. error: literal non-ASCII character detected
  3317. --> src/ops.rs:145:30
  3318. |
  3319. 145 | .context(format!("Can't find ν{v}"))?;
  3320. | ^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't find \u{3bd}{v}"`
  3321. |
  3322. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3323.  
  3324. error: docs for function returning `Result` missing `# Errors` section
  3325. --> src/ops.rs:184:5
  3326. |
  3327. 184 | pub fn kids(&self, v: u32) -> Result<Vec<(String, String, u32)>> {
  3328. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3329. |
  3330. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  3331.  
  3332. error: missing `#[inline]` for a method
  3333. --> src/ops.rs:184:5
  3334. |
  3335. 184 | / pub fn kids(&self, v: u32) -> Result<Vec<(String, String, u32)>> {
  3336. 185 | | let vtx = self.vertices.get(&v).context(format!("Can't find ν{v}"))?;
  3337. 186 | | let kids = vtx
  3338. 187 | | .edges
  3339. ... |
  3340. 194 | | Ok(kids)
  3341. 195 | | }
  3342. | |_____^
  3343. |
  3344. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3345.  
  3346. error: missing `return` statement
  3347. --> src/ops.rs:194:9
  3348. |
  3349. 194 | Ok(kids)
  3350. | ^^^^^^^^ help: add `return` as shown: `return Ok(kids)`
  3351. |
  3352. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3353.  
  3354. error: literal non-ASCII character detected
  3355. --> src/ops.rs:185:57
  3356. |
  3357. 185 | let vtx = self.vertices.get(&v).context(format!("Can't find ν{v}"))?;
  3358. | ^^^^^^^^^^^^^^^^^ help: consider replacing the string with: `"Can't find \u{3bd}{v}"`
  3359. |
  3360. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  3361.  
  3362. error: missing `return` statement
  3363. --> src/ops.rs:191:17
  3364. |
  3365. 191 | (p.0, p.1, x.to)
  3366. | ^^^^^^^^^^^^^^^^ help: add `return` as shown: `return (p.0, p.1, x.to)`
  3367. |
  3368. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3369.  
  3370. error: this method could have a `#[must_use]` attribute
  3371. --> src/ops.rs:212:5
  3372. |
  3373. 212 | pub fn kid(&self, v: u32, a: &str) -> Option<(u32, String)> {
  3374. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn kid(&self, v: u32, a: &str) -> Option<(u32, String)>`
  3375. |
  3376. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  3377.  
  3378. error: missing `#[inline]` for a method
  3379. --> src/ops.rs:212:5
  3380. |
  3381. 212 | / pub fn kid(&self, v: u32, a: &str) -> Option<(u32, String)> {
  3382. 213 | | if let Some(vtx) = self.vertices.get(&v) {
  3383. 214 | | vtx.edges
  3384. 215 | | .iter()
  3385. ... |
  3386. 220 | | }
  3387. 221 | | }
  3388. | |_____^
  3389. |
  3390. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3391.  
  3392. error: missing `return` statement
  3393. --> src/ops.rs:214:13
  3394. |
  3395. 214 | / vtx.edges
  3396. 215 | | .iter()
  3397. 216 | | .find(|e| Self::split_a(&e.a).0 == Self::split_a(a).0)
  3398. 217 | | .map(|e| (e.to, Self::split_a(&e.a).1))
  3399. | |_______________________________________________________^
  3400. |
  3401. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3402. help: add `return` as shown
  3403. |
  3404. 214 ~ return vtx.edges
  3405. 215 + .iter()
  3406. 216 + .find(|e| Self::split_a(&e.a).0 == Self::split_a(a).0)
  3407. 217 + .map(|e| (e.to, Self::split_a(&e.a).1))
  3408. |
  3409.  
  3410. error: missing `return` statement
  3411. --> src/ops.rs:219:13
  3412. |
  3413. 219 | None
  3414. | ^^^^ help: add `return` as shown: `return None`
  3415. |
  3416. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3417.  
  3418. error: use Option::map_or instead of an if let/else
  3419. --> src/ops.rs:213:9
  3420. |
  3421. 213 | / if let Some(vtx) = self.vertices.get(&v) {
  3422. 214 | | vtx.edges
  3423. 215 | | .iter()
  3424. 216 | | .find(|e| Self::split_a(&e.a).0 == Self::split_a(a).0)
  3425. ... |
  3426. 219 | | None
  3427. 220 | | }
  3428. | |_________^
  3429. |
  3430. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else
  3431. = note: `#[deny(clippy::option_if_let_else)]` implied by `#[deny(warnings)]`
  3432. help: try
  3433. |
  3434. 213 ~ self.vertices.get(&v).map_or(None, |vtx| vtx.edges
  3435. 214 + .iter()
  3436. 215 + .find(|e| Self::split_a(&e.a).0 == Self::split_a(a).0)
  3437. 216 + .map(|e| (e.to, Self::split_a(&e.a).1)))
  3438. |
  3439.  
  3440. error: missing `return` statement
  3441. --> src/ops.rs:216:27
  3442. |
  3443. 216 | .find(|e| Self::split_a(&e.a).0 == Self::split_a(a).0)
  3444. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Self::split_a(&e.a).0 == Self::split_a(a).0`
  3445. |
  3446. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3447.  
  3448. error: missing `return` statement
  3449. --> src/ops.rs:217:26
  3450. |
  3451. 217 | .map(|e| (e.to, Self::split_a(&e.a).1))
  3452. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return (e.to, Self::split_a(&e.a).1)`
  3453. |
  3454. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3455.  
  3456. error: missing `return` statement
  3457. --> src/ops.rs:226:9
  3458. |
  3459. 226 | / (
  3460. 227 | | s.first().unwrap().to_string(),
  3461. 228 | | s.get(1).unwrap_or(&"").to_string(),
  3462. 229 | | )
  3463. | |_________^
  3464. |
  3465. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3466. help: add `return` as shown
  3467. |
  3468. 226 ~ return (
  3469. 227 + s.first().unwrap().to_string(),
  3470. 228 + s.get(1).unwrap_or(&"").to_string(),
  3471. 229 + )
  3472. |
  3473.  
  3474. error: calling `to_string` on `&&str`
  3475. --> src/ops.rs:227:13
  3476. |
  3477. 227 | s.first().unwrap().to_string(),
  3478. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*s.first().unwrap()).to_string()`
  3479. |
  3480. = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
  3481. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
  3482. = note: `#[deny(clippy::inefficient_to_string)]` implied by `#[deny(warnings)]`
  3483.  
  3484. error: used `unwrap()` on an `Option` value
  3485. --> src/ops.rs:227:13
  3486. |
  3487. 227 | s.first().unwrap().to_string(),
  3488. | ^^^^^^^^^^^^^^^^^^
  3489. |
  3490. = help: if this value is `None`, it will panic
  3491. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  3492.  
  3493. error: calling `to_string` on `&&str`
  3494. --> src/ops.rs:228:13
  3495. |
  3496. 228 | s.get(1).unwrap_or(&"").to_string(),
  3497. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*s.get(1).unwrap_or(&"")).to_string()`
  3498. |
  3499. = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
  3500. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
  3501.  
  3502. error: missing documentation for a module
  3503. --> src/lib.rs:63:1
  3504. |
  3505. 63 | mod script;
  3506. | ^^^^^^^^^^^
  3507. |
  3508. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  3509.  
  3510. error: used import from `std` instead of `core`
  3511. --> src/script.rs:28:5
  3512. |
  3513. 28 | use std::str::FromStr;
  3514. | ^^^^^^^^^^^^^^^^^
  3515. |
  3516. = help: consider importing the item from `core`
  3517. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  3518.  
  3519. error: missing documentation for a struct field
  3520. --> src/script.rs:45:5
  3521. |
  3522. 45 | txt: String,
  3523. | ^^^^^^^^^^^
  3524. |
  3525. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  3526.  
  3527. error: missing documentation for a struct field
  3528. --> src/script.rs:46:5
  3529. |
  3530. 46 | vars: HashMap<String, u32>,
  3531. | ^^^^^^^^^^^^^^^^^^^^^^^^^^
  3532. |
  3533. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  3534.  
  3535. error: this method could have a `#[must_use]` attribute
  3536. --> src/script.rs:73:5
  3537. |
  3538. 73 | pub fn from_str(s: &str) -> Script {
  3539. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn from_str(s: &str) -> Script`
  3540. |
  3541. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  3542.  
  3543. error: missing `#[inline]` for a method
  3544. --> src/script.rs:73:5
  3545. |
  3546. 73 | / pub fn from_str(s: &str) -> Script {
  3547. 74 | | Script {
  3548. 75 | | txt: s.to_string(),
  3549. 76 | | vars: HashMap::new(),
  3550. 77 | | }
  3551. 78 | | }
  3552. | |_____^
  3553. |
  3554. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3555.  
  3556. error: missing `return` statement
  3557. --> src/script.rs:74:9
  3558. |
  3559. 74 | / Script {
  3560. 75 | | txt: s.to_string(),
  3561. 76 | | vars: HashMap::new(),
  3562. 77 | | }
  3563. | |_________^
  3564. |
  3565. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3566. help: add `return` as shown
  3567. |
  3568. 74 ~ return Script {
  3569. 75 + txt: s.to_string(),
  3570. 76 + vars: HashMap::new(),
  3571. 77 + }
  3572. |
  3573.  
  3574. error: unnecessary structure name repetition
  3575. --> src/script.rs:73:33
  3576. |
  3577. 73 | pub fn from_str(s: &str) -> Script {
  3578. | ^^^^^^ help: use the applicable keyword: `Self`
  3579. |
  3580. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  3581.  
  3582. error: unnecessary structure name repetition
  3583. --> src/script.rs:74:9
  3584. |
  3585. 74 | Script {
  3586. | ^^^^^^ help: use the applicable keyword: `Self`
  3587. |
  3588. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  3589.  
  3590. error: `to_string()` called on a `&str`
  3591. --> src/script.rs:75:18
  3592. |
  3593. 75 | txt: s.to_string(),
  3594. | ^^^^^^^^^^^^^
  3595. |
  3596. = help: consider using `.to_owned()`
  3597. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  3598.  
  3599. error: this method could have a `#[must_use]` attribute
  3600. --> src/script.rs:81:5
  3601. |
  3602. 81 | pub fn from_string(s: String) -> Script {
  3603. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn from_string(s: String) -> Script`
  3604. |
  3605. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
  3606.  
  3607. error: missing `#[inline]` for a method
  3608. --> src/script.rs:81:5
  3609. |
  3610. 81 | / pub fn from_string(s: String) -> Script {
  3611. 82 | | Script::from_str(s.as_str())
  3612. 83 | | }
  3613. | |_____^
  3614. |
  3615. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3616.  
  3617. error: missing `return` statement
  3618. --> src/script.rs:82:9
  3619. |
  3620. 82 | Script::from_str(s.as_str())
  3621. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Script::from_str(s.as_str())`
  3622. |
  3623. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3624.  
  3625. error: this argument is passed by value, but not consumed in the function body
  3626. --> src/script.rs:81:27
  3627. |
  3628. 81 | pub fn from_string(s: String) -> Script {
  3629. | ^^^^^^
  3630. |
  3631. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
  3632. help: consider changing the type to
  3633. |
  3634. 81 | pub fn from_string(s: &str) -> Script {
  3635. | ~~~~
  3636. help: change `s.as_str()` to
  3637. |
  3638. 82 | Script::from_str(s)
  3639. | ~
  3640.  
  3641. error: unnecessary structure name repetition
  3642. --> src/script.rs:81:38
  3643. |
  3644. 81 | pub fn from_string(s: String) -> Script {
  3645. | ^^^^^^ help: use the applicable keyword: `Self`
  3646. |
  3647. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  3648.  
  3649. error: unnecessary structure name repetition
  3650. --> src/script.rs:82:9
  3651. |
  3652. 82 | Script::from_str(s.as_str())
  3653. | ^^^^^^ help: use the applicable keyword: `Self`
  3654. |
  3655. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  3656.  
  3657. error: docs for function returning `Result` missing `# Errors` section
  3658. --> src/script.rs:86:5
  3659. |
  3660. 86 | pub fn deploy_to(&mut self, g: &mut Sodg) -> Result<usize> {
  3661. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3662. |
  3663. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  3664.  
  3665. error: missing `#[inline]` for a method
  3666. --> src/script.rs:86:5
  3667. |
  3668. 86 | / pub fn deploy_to(&mut self, g: &mut Sodg) -> Result<usize> {
  3669. 87 | | let mut pos = 0;
  3670. 88 | | for cmd in self.commands().iter() {
  3671. 89 | | trace!("#deploy_to: deploying command no.{} '{}'...", pos + 1, cmd);
  3672. ... |
  3673. 94 | | Ok(pos)
  3674. 95 | | }
  3675. | |_____^
  3676. |
  3677. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  3678.  
  3679. error: missing `return` statement
  3680. --> src/script.rs:94:9
  3681. |
  3682. 94 | Ok(pos)
  3683. | ^^^^^^^ help: add `return` as shown: `return Ok(pos)`
  3684. |
  3685. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3686.  
  3687. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  3688. --> src/script.rs:88:20
  3689. |
  3690. 88 | for cmd in self.commands().iter() {
  3691. | ^^^^^^^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&self.commands()`
  3692. |
  3693. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  3694.  
  3695. error: arithmetic operation that can potentially result in unexpected side-effects
  3696. --> src/script.rs:89:67
  3697. |
  3698. 89 | trace!("#deploy_to: deploying command no.{} '{}'...", pos + 1, cmd);
  3699. | ^^^^^^^
  3700. |
  3701. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  3702.  
  3703. error: integer arithmetic detected
  3704. --> src/script.rs:89:67
  3705. |
  3706. 89 | trace!("#deploy_to: deploying command no.{} '{}'...", pos + 1, cmd);
  3707. | ^^^^^^^
  3708. |
  3709. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  3710.  
  3711. error: arithmetic operation that can potentially result in unexpected side-effects
  3712. --> src/script.rs:92:13
  3713. |
  3714. 92 | pos += 1;
  3715. | ^^^^^^^^
  3716. |
  3717. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  3718.  
  3719. error: integer arithmetic detected
  3720. --> src/script.rs:92:13
  3721. |
  3722. 92 | pos += 1;
  3723. | ^^^^^^^^
  3724. |
  3725. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  3726.  
  3727. error: missing `return` statement
  3728. --> src/script.rs:104:9
  3729. |
  3730. 104 | / clean
  3731. 105 | | .split(';')
  3732. 106 | | .map(|t| t.trim())
  3733. 107 | | .filter(|t| !t.is_empty())
  3734. 108 | | .map(|t| t.to_string())
  3735. 109 | | .collect()
  3736. | |______________________^
  3737. |
  3738. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3739. help: add `return` as shown
  3740. |
  3741. 104 ~ return clean
  3742. 105 + .split(';')
  3743. 106 + .map(|t| t.trim())
  3744. 107 + .filter(|t| !t.is_empty())
  3745. 108 + .map(|t| t.to_string())
  3746. 109 + .collect()
  3747. |
  3748.  
  3749. error: used `unwrap()` on a `Result` value
  3750. --> src/script.rs:100:48
  3751. |
  3752. 100 | static ref STRIP_COMMENTS: Regex = Regex::new("#.*\n").unwrap();
  3753. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3754. |
  3755. = help: if this value is an `Err`, it will panic
  3756. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  3757.  
  3758. error: redundant closure
  3759. --> src/script.rs:106:18
  3760. |
  3761. 106 | .map(|t| t.trim())
  3762. | ^^^^^^^^^^^^ help: replace the closure with the method itself: `str::trim`
  3763. |
  3764. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
  3765. = note: `#[deny(clippy::redundant_closure_for_method_calls)]` implied by `#[deny(warnings)]`
  3766.  
  3767. error: missing `return` statement
  3768. --> src/script.rs:106:22
  3769. |
  3770. 106 | .map(|t| t.trim())
  3771. | ^^^^^^^^ help: add `return` as shown: `return t.trim()`
  3772. |
  3773. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3774.  
  3775. error: missing `return` statement
  3776. --> src/script.rs:107:25
  3777. |
  3778. 107 | .filter(|t| !t.is_empty())
  3779. | ^^^^^^^^^^^^^ help: add `return` as shown: `return !t.is_empty()`
  3780. |
  3781. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3782.  
  3783. error: redundant closure
  3784. --> src/script.rs:108:18
  3785. |
  3786. 108 | .map(|t| t.to_string())
  3787. | ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
  3788. |
  3789. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
  3790.  
  3791. error: missing `return` statement
  3792. --> src/script.rs:108:22
  3793. |
  3794. 108 | .map(|t| t.to_string())
  3795. | ^^^^^^^^^^^^^ help: add `return` as shown: `return t.to_string()`
  3796. |
  3797. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3798.  
  3799. error: `to_string()` called on a `&str`
  3800. --> src/script.rs:108:22
  3801. |
  3802. 108 | .map(|t| t.to_string())
  3803. | ^^^^^^^^^^^^^
  3804. |
  3805. = help: consider using `.to_owned()`
  3806. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  3807.  
  3808. error: missing `return` statement
  3809. --> src/script.rs:127:17
  3810. |
  3811. 127 | g.add(v).context(format!("Failed to ADD({})", &args[0]))
  3812. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return g.add(v).context(format!("Failed to ADD({})", &args[0]))`
  3813. |
  3814. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3815.  
  3816. error: missing `return` statement
  3817. --> src/script.rs:133:17
  3818. |
  3819. 133 | / g.bind(v1, v2, a).context(format!(
  3820. 134 | | "Failed to BIND({}, {}, {})",
  3821. 135 | | &args[0], &args[1], &args[2]
  3822. 136 | | ))
  3823. | |__________________^
  3824. |
  3825. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3826. help: add `return` as shown
  3827. |
  3828. 133 ~ return g.bind(v1, v2, a).context(format!(
  3829. 134 + "Failed to BIND({}, {}, {})",
  3830. 135 + &args[0], &args[1], &args[2]
  3831. 136 + ))
  3832. |
  3833.  
  3834. error: missing `return` statement
  3835. --> src/script.rs:140:17
  3836. |
  3837. 140 | / g.put(v, Self::parse_data(&args[1])?)
  3838. 141 | | .context(format!("Failed to PUT({})", &args[0]))
  3839. | |____________________________________________________________________^
  3840. |
  3841. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3842. help: add `return` as shown
  3843. |
  3844. 140 ~ return g.put(v, Self::parse_data(&args[1])?)
  3845. 141 + .context(format!("Failed to PUT({})", &args[0]))
  3846. |
  3847.  
  3848. error: missing `return` statement
  3849. --> src/script.rs:143:21
  3850. |
  3851. 143 | _cmd => Err(anyhow!("Unknown command: {_cmd}")),
  3852. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Err(anyhow!("Unknown command: {_cmd}"))`
  3853. |
  3854. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3855.  
  3856. error: used `unwrap()` on a `Result` value
  3857. --> src/script.rs:115:38
  3858. |
  3859. 115 | static ref LINE: Regex = Regex::new("^([A-Z]+) *\\(([^)]*)\\)$").unwrap();
  3860. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3861. |
  3862. = help: if this value is an `Err`, it will panic
  3863. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  3864.  
  3865. error: indexing may panic
  3866. --> src/script.rs:118:33
  3867. |
  3868. 118 | let args: Vec<String> = cap[2]
  3869. | ^^^^^^
  3870. |
  3871. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3872. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3873.  
  3874. error: redundant closure
  3875. --> src/script.rs:120:18
  3876. |
  3877. 120 | .map(|t| t.trim())
  3878. | ^^^^^^^^^^^^ help: replace the closure with the method itself: `str::trim`
  3879. |
  3880. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
  3881.  
  3882. error: missing `return` statement
  3883. --> src/script.rs:120:22
  3884. |
  3885. 120 | .map(|t| t.trim())
  3886. | ^^^^^^^^ help: add `return` as shown: `return t.trim()`
  3887. |
  3888. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3889.  
  3890. error: missing `return` statement
  3891. --> src/script.rs:121:25
  3892. |
  3893. 121 | .filter(|t| !t.is_empty())
  3894. | ^^^^^^^^^^^^^ help: add `return` as shown: `return !t.is_empty()`
  3895. |
  3896. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3897.  
  3898. error: redundant closure
  3899. --> src/script.rs:122:18
  3900. |
  3901. 122 | .map(|t| t.to_string())
  3902. | ^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
  3903. |
  3904. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
  3905.  
  3906. error: missing `return` statement
  3907. --> src/script.rs:122:22
  3908. |
  3909. 122 | .map(|t| t.to_string())
  3910. | ^^^^^^^^^^^^^ help: add `return` as shown: `return t.to_string()`
  3911. |
  3912. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  3913.  
  3914. error: `to_string()` called on a `&str`
  3915. --> src/script.rs:122:22
  3916. |
  3917. 122 | .map(|t| t.to_string())
  3918. | ^^^^^^^^^^^^^
  3919. |
  3920. = help: consider using `.to_owned()`
  3921. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  3922.  
  3923. error: indexing may panic
  3924. --> src/script.rs:124:16
  3925. |
  3926. 124 | match &cap[1] {
  3927. | ^^^^^^
  3928. |
  3929. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3930. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3931.  
  3932. error: indexing may panic
  3933. --> src/script.rs:126:37
  3934. |
  3935. 126 | let v = self.parse(&args[0], g)?;
  3936. | ^^^^^^^
  3937. |
  3938. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3939. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3940.  
  3941. error: indexing may panic
  3942. --> src/script.rs:127:64
  3943. |
  3944. 127 | g.add(v).context(format!("Failed to ADD({})", &args[0]))
  3945. | ^^^^^^^
  3946. |
  3947. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3948. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3949.  
  3950. error: indexing may panic
  3951. --> src/script.rs:130:38
  3952. |
  3953. 130 | let v1 = self.parse(&args[0], g)?;
  3954. | ^^^^^^^
  3955. |
  3956. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3957. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3958.  
  3959. error: indexing may panic
  3960. --> src/script.rs:131:38
  3961. |
  3962. 131 | let v2 = self.parse(&args[1], g)?;
  3963. | ^^^^^^^
  3964. |
  3965. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3966. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3967.  
  3968. error: indexing may panic
  3969. --> src/script.rs:132:26
  3970. |
  3971. 132 | let a = &args[2];
  3972. | ^^^^^^^
  3973. |
  3974. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3975. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3976.  
  3977. error: indexing may panic
  3978. --> src/script.rs:135:22
  3979. |
  3980. 135 | &args[0], &args[1], &args[2]
  3981. | ^^^^^^^
  3982. |
  3983. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3984. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3985.  
  3986. error: indexing may panic
  3987. --> src/script.rs:135:32
  3988. |
  3989. 135 | &args[0], &args[1], &args[2]
  3990. | ^^^^^^^
  3991. |
  3992. = help: consider using `.get(n)` or `.get_mut(n)` instead
  3993. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  3994.  
  3995. error: indexing may panic
  3996. --> src/script.rs:135:42
  3997. |
  3998. 135 | &args[0], &args[1], &args[2]
  3999. | ^^^^^^^
  4000. |
  4001. = help: consider using `.get(n)` or `.get_mut(n)` instead
  4002. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  4003.  
  4004. error: indexing may panic
  4005. --> src/script.rs:139:37
  4006. |
  4007. 139 | let v = self.parse(&args[0], g)?;
  4008. | ^^^^^^^
  4009. |
  4010. = help: consider using `.get(n)` or `.get_mut(n)` instead
  4011. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  4012.  
  4013. error: indexing may panic
  4014. --> src/script.rs:140:44
  4015. |
  4016. 140 | g.put(v, Self::parse_data(&args[1])?)
  4017. | ^^^^^^^
  4018. |
  4019. = help: consider using `.get(n)` or `.get_mut(n)` instead
  4020. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  4021.  
  4022. error: indexing may panic
  4023. --> src/script.rs:141:60
  4024. |
  4025. 141 | .context(format!("Failed to PUT({})", &args[0]))
  4026. | ^^^^^^^
  4027. |
  4028. = help: consider using `.get(n)` or `.get_mut(n)` instead
  4029. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  4030.  
  4031. error: used binding `_cmd` which is prefixed with an underscore. A leading underscore signals that a binding will not be used
  4032. --> src/script.rs:143:52
  4033. |
  4034. 143 | _cmd => Err(anyhow!("Unknown command: {_cmd}")),
  4035. | ^^^^
  4036. |
  4037. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
  4038. = note: `#[deny(clippy::used_underscore_binding)]` implied by `#[deny(warnings)]`
  4039.  
  4040. error: missing `return` statement
  4041. --> src/script.rs:159:13
  4042. |
  4043. 159 | Ok(Hex::from_vec(bytes))
  4044. | ^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(Hex::from_vec(bytes))`
  4045. |
  4046. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4047.  
  4048. error: missing `return` statement
  4049. --> src/script.rs:161:13
  4050. |
  4051. 161 | Err(anyhow!("Can't parse data '{s}'"))
  4052. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Err(anyhow!("Can't parse data '{s}'"))`
  4053. |
  4054. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4055.  
  4056. error: used `unwrap()` on a `Result` value
  4057. --> src/script.rs:150:44
  4058. |
  4059. 150 | static ref DATA_STRIP: Regex = Regex::new("[ \t\n\r\\-]").unwrap();
  4060. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4061. |
  4062. = help: if this value is an `Err`, it will panic
  4063. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4064.  
  4065. error: used `unwrap()` on a `Result` value
  4066. --> src/script.rs:151:38
  4067. |
  4068. 151 | static ref DATA: Regex = Regex::new("^[0-9A-Fa-f]{2}([0-9A-Fa-f]{2})*$").unwrap();
  4069. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4070. |
  4071. = help: if this value is an `Err`, it will panic
  4072. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4073.  
  4074. error: missing `return` statement
  4075. --> src/script.rs:157:26
  4076. |
  4077. 157 | .map(|i| u8::from_str_radix(&d[i..i + 2], 16).unwrap())
  4078. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return u8::from_str_radix(&d[i..i + 2], 16).unwrap()`
  4079. |
  4080. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4081.  
  4082. error: used `unwrap()` on a `Result` value
  4083. --> src/script.rs:157:26
  4084. |
  4085. 157 | .map(|i| u8::from_str_radix(&d[i..i + 2], 16).unwrap())
  4086. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4087. |
  4088. = help: if this value is an `Err`, it will panic
  4089. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4090.  
  4091. error: indexing into a string may panic if the index is within a UTF-8 character
  4092. --> src/script.rs:157:46
  4093. |
  4094. 157 | .map(|i| u8::from_str_radix(&d[i..i + 2], 16).unwrap())
  4095. | ^^^^^^^^^^^
  4096. |
  4097. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#string_slice
  4098. = note: `#[deny(clippy::string_slice)]` implied by `#[deny(warnings)]`
  4099.  
  4100. error: slicing may panic
  4101. --> src/script.rs:157:46
  4102. |
  4103. 157 | .map(|i| u8::from_str_radix(&d[i..i + 2], 16).unwrap())
  4104. | ^^^^^^^^^^^
  4105. |
  4106. = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
  4107. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
  4108.  
  4109. error: arithmetic operation that can potentially result in unexpected side-effects
  4110. --> src/script.rs:157:51
  4111. |
  4112. 157 | .map(|i| u8::from_str_radix(&d[i..i + 2], 16).unwrap())
  4113. | ^^^^^
  4114. |
  4115. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arithmetic_side_effects
  4116.  
  4117. error: integer arithmetic detected
  4118. --> src/script.rs:157:51
  4119. |
  4120. 157 | .map(|i| u8::from_str_radix(&d[i..i + 2], 16).unwrap())
  4121. | ^^^^^
  4122. |
  4123. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
  4124.  
  4125. error: missing `return` statement
  4126. --> src/script.rs:171:17
  4127. |
  4128. 171 | Ok(*self.vars.entry(tail).or_insert_with(|| g.next_id()))
  4129. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(*self.vars.entry(tail).or_insert_with(|| g.next_id()))`
  4130. |
  4131. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4132.  
  4133. error: missing `return` statement
  4134. --> src/script.rs:173:17
  4135. |
  4136. 173 | Ok(u32::from_str(tail.as_str()).context(format!("Parsing of '{s}' failed"))?)
  4137. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(u32::from_str(tail.as_str()).context(format!("Parsing of '{s}' failed"))?)`
  4138. |
  4139. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4140.  
  4141. error: missing `return` statement
  4142. --> src/script.rs:177:13
  4143. |
  4144. 177 | Ok(v)
  4145. | ^^^^^ help: add `return` as shown: `return Ok(v)`
  4146. |
  4147. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4148.  
  4149. error: `to_string()` called on a `&str`
  4150. --> src/script.rs:167:45
  4151. |
  4152. 167 | let head = s.chars().next().context("Empty identifier".to_string())?;
  4153. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4154. |
  4155. = help: consider using `.to_owned()`
  4156. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  4157.  
  4158. error: literal non-ASCII character detected
  4159. --> src/script.rs:168:35
  4160. |
  4161. 168 | if head == '$' || head == 'ν' {
  4162. | ^^^ help: consider replacing the string with: `'\u{3bd}'`
  4163. |
  4164. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_ascii_literal
  4165.  
  4166. error: missing `return` statement
  4167. --> src/script.rs:171:61
  4168. |
  4169. 171 | Ok(*self.vars.entry(tail).or_insert_with(|| g.next_id()))
  4170. | ^^^^^^^^^^^ help: add `return` as shown: `return g.next_id()`
  4171. |
  4172. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4173.  
  4174. error: missing documentation for a module
  4175. --> src/lib.rs:64:1
  4176. |
  4177. 64 | mod serialization;
  4178. | ^^^^^^^^^^^^^^^^^^
  4179. |
  4180. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  4181.  
  4182. error: docs for function returning `Result` missing `# Errors` section
  4183. --> src/serialization.rs:34:5
  4184. |
  4185. 34 | pub fn save(&mut self, path: &Path) -> Result<usize> {
  4186. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4187. |
  4188. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  4189.  
  4190. error: missing `#[inline]` for a method
  4191. --> src/serialization.rs:34:5
  4192. |
  4193. 34 | / pub fn save(&mut self, path: &Path) -> Result<usize> {
  4194. 35 | | let start = Instant::now();
  4195. 36 | | let bytes: Vec<u8> = serialize(self).context("Failed to serialize")?;
  4196. 37 | | let size = bytes.len();
  4197. ... |
  4198. 45 | | Ok(size)
  4199. 46 | | }
  4200. | |_____^
  4201. |
  4202. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  4203.  
  4204. error: missing `return` statement
  4205. --> src/serialization.rs:45:9
  4206. |
  4207. 45 | Ok(size)
  4208. | ^^^^^^^^ help: add `return` as shown: `return Ok(size)`
  4209. |
  4210. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4211.  
  4212. error: docs for function returning `Result` missing `# Errors` section
  4213. --> src/serialization.rs:50:5
  4214. |
  4215. 50 | pub fn load(path: &Path) -> Result<Sodg> {
  4216. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4217. |
  4218. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  4219.  
  4220. error: missing `#[inline]` for a method
  4221. --> src/serialization.rs:50:5
  4222. |
  4223. 50 | / pub fn load(path: &Path) -> Result<Sodg> {
  4224. 51 | | let start = Instant::now();
  4225. 52 | | let bytes = fs::read(path).context(format!("Can't read from {}", path.display()))?;
  4226. 53 | | let size = bytes.len();
  4227. ... |
  4228. 62 | | Ok(sodg)
  4229. 63 | | }
  4230. | |_____^
  4231. |
  4232. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  4233.  
  4234. error: missing `return` statement
  4235. --> src/serialization.rs:62:9
  4236. |
  4237. 62 | Ok(sodg)
  4238. | ^^^^^^^^ help: add `return` as shown: `return Ok(sodg)`
  4239. |
  4240. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4241.  
  4242. error: unnecessary structure name repetition
  4243. --> src/serialization.rs:50:40
  4244. |
  4245. 50 | pub fn load(path: &Path) -> Result<Sodg> {
  4246. | ^^^^ help: use the applicable keyword: `Self`
  4247. |
  4248. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  4249.  
  4250. error: missing documentation for a module
  4251. --> src/lib.rs:65:1
  4252. |
  4253. 65 | mod slice;
  4254. | ^^^^^^^^^^
  4255. |
  4256. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  4257.  
  4258. error: docs for function returning `Result` missing `# Errors` section
  4259. --> src/slice.rs:29:5
  4260. |
  4261. 29 | pub fn slice(&mut self, loc: &str) -> Result<Sodg> {
  4262. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4263. |
  4264. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  4265.  
  4266. error: missing `#[inline]` for a method
  4267. --> src/slice.rs:29:5
  4268. |
  4269. 29 | / pub fn slice(&mut self, loc: &str) -> Result<Sodg> {
  4270. 30 | | self.slice_some(loc, |_v, _to, _a| true)
  4271. 31 | | }
  4272. | |_____^
  4273. |
  4274. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  4275.  
  4276. error: missing `return` statement
  4277. --> src/slice.rs:30:9
  4278. |
  4279. 30 | self.slice_some(loc, |_v, _to, _a| true)
  4280. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return self.slice_some(loc, |_v, _to, _a| true)`
  4281. |
  4282. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4283.  
  4284. error: unnecessary structure name repetition
  4285. --> src/slice.rs:29:50
  4286. |
  4287. 29 | pub fn slice(&mut self, loc: &str) -> Result<Sodg> {
  4288. | ^^^^ help: use the applicable keyword: `Self`
  4289. |
  4290. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  4291.  
  4292. error: missing `return` statement
  4293. --> src/slice.rs:30:44
  4294. |
  4295. 30 | self.slice_some(loc, |_v, _to, _a| true)
  4296. | ^^^^ help: add `return` as shown: `return true`
  4297. |
  4298. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4299.  
  4300. error: docs for function which may panic missing `# Panics` section
  4301. --> src/slice.rs:37:5
  4302. |
  4303. 37 | pub fn slice_some(&mut self, loc: &str, p: fn(u32, u32, String) -> bool) -> Result<Sodg> {
  4304. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4305. |
  4306. note: first possible panic found here
  4307. --> src/slice.rs:48:27
  4308. |
  4309. 48 | let vtx = self.vertices.get(&v).unwrap();
  4310. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4311. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
  4312.  
  4313. error: docs for function returning `Result` missing `# Errors` section
  4314. --> src/slice.rs:37:5
  4315. |
  4316. 37 | pub fn slice_some(&mut self, loc: &str, p: fn(u32, u32, String) -> bool) -> Result<Sodg> {
  4317. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4318. |
  4319. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  4320.  
  4321. error: missing `#[inline]` for a method
  4322. --> src/slice.rs:37:5
  4323. |
  4324. 37 | / pub fn slice_some(&mut self, loc: &str, p: fn(u32, u32, String) -> bool) -> Result<Sodg> {
  4325. 38 | | let mut todo = HashSet::new();
  4326. 39 | | let mut done = HashSet::new();
  4327. 40 | | todo.insert(self.find(0, loc, &DeadRelay::default())?);
  4328. ... |
  4329. 72 | | })
  4330. 73 | | }
  4331. | |_____^
  4332. |
  4333. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  4334.  
  4335. error: used unwrap or expect in a function that returns result or option
  4336. --> src/slice.rs:37:5
  4337. |
  4338. 37 | / pub fn slice_some(&mut self, loc: &str, p: fn(u32, u32, String) -> bool) -> Result<Sodg> {
  4339. 38 | | let mut todo = HashSet::new();
  4340. 39 | | let mut done = HashSet::new();
  4341. 40 | | todo.insert(self.find(0, loc, &DeadRelay::default())?);
  4342. ... |
  4343. 72 | | })
  4344. 73 | | }
  4345. | |_____^
  4346. |
  4347. = help: unwrap and expect should not be used in a function that returns result or option
  4348. note: potential non-recoverable error(s)
  4349. --> src/slice.rs:48:27
  4350. |
  4351. 48 | let vtx = self.vertices.get(&v).unwrap();
  4352. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4353. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result
  4354.  
  4355. error: missing `return` statement
  4356. --> src/slice.rs:65:9
  4357. |
  4358. 65 | / Ok(Sodg {
  4359. 66 | | vertices: new_vertices,
  4360. 67 | | next_v: self.next_v,
  4361. 68 | | alerts: self.alerts.clone(),
  4362. ... |
  4363. 71 | | finds: HashSet::new(),
  4364. 72 | | })
  4365. | |__________^
  4366. |
  4367. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4368. help: add `return` as shown
  4369. |
  4370. 65 ~ return Ok(Sodg {
  4371. 66 + vertices: new_vertices,
  4372. 67 + next_v: self.next_v,
  4373. 68 + alerts: self.alerts.clone(),
  4374. 69 + alerts_active: self.alerts_active,
  4375. 70 + #[cfg(feature = "sober")]
  4376. 71 + finds: HashSet::new(),
  4377. 72 + })
  4378. |
  4379.  
  4380. error: unnecessary structure name repetition
  4381. --> src/slice.rs:37:88
  4382. |
  4383. 37 | pub fn slice_some(&mut self, loc: &str, p: fn(u32, u32, String) -> bool) -> Result<Sodg> {
  4384. | ^^^^ help: use the applicable keyword: `Self`
  4385. |
  4386. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  4387.  
  4388. error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
  4389. --> src/slice.rs:48:27
  4390. |
  4391. 48 | let vtx = self.vertices.get(&v).unwrap();
  4392. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&self.vertices[&v]`
  4393. |
  4394. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
  4395.  
  4396. error: used `unwrap()` on an `Option` value
  4397. --> src/slice.rs:48:27
  4398. |
  4399. 48 | let vtx = self.vertices.get(&v).unwrap();
  4400. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4401. |
  4402. = help: if this value is `None`, it will panic
  4403. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4404.  
  4405. error: it is more concise to loop over references to containers instead of using explicit iteration methods
  4406. --> src/slice.rs:49:26
  4407. |
  4408. 49 | for e in vtx.edges.iter() {
  4409. | ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&vtx.edges`
  4410. |
  4411. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_iter_loop
  4412.  
  4413. error: missing `return` statement
  4414. --> src/slice.rs:62:62
  4415. |
  4416. 62 | for (v, vtx) in self.vertices.iter().filter(|(v, _)| done.contains(v)) {
  4417. | ^^^^^^^^^^^^^^^^ help: add `return` as shown: `return done.contains(v)`
  4418. |
  4419. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4420.  
  4421. error: type of pattern does not match the expression type
  4422. --> src/slice.rs:62:54
  4423. |
  4424. 62 | for (v, vtx) in self.vertices.iter().filter(|(v, _)| done.contains(v)) {
  4425. | ^^^^^^
  4426. |
  4427. = help: explicitly match against a `&_` pattern and adjust the enclosed variable bindings
  4428. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
  4429.  
  4430. error: unnecessary structure name repetition
  4431. --> src/slice.rs:65:12
  4432. |
  4433. 65 | Ok(Sodg {
  4434. | ^^^^ help: use the applicable keyword: `Self`
  4435. |
  4436. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  4437.  
  4438. error: missing documentation for a module
  4439. --> src/lib.rs:66:1
  4440. |
  4441. 66 | mod vertex;
  4442. | ^^^^^^^^^^^
  4443. |
  4444. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  4445.  
  4446. error: pub(crate) struct inside private module
  4447. --> src/vertex.rs:26:1
  4448. |
  4449. 26 | pub(crate) struct Vertex {
  4450. | ----------^^^^^^^^^^^^^^
  4451. | |
  4452. | help: consider using: `pub`
  4453. |
  4454. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate
  4455.  
  4456. error: missing `return` statement
  4457. --> src/vertex.rs:48:9
  4458. |
  4459. 48 | / Vertex {
  4460. 49 | | edges: vec![],
  4461. 50 | | data: Hex::empty(),
  4462. 51 | | parents: HashSet::new(),
  4463. 52 | | taken: false,
  4464. 53 | | }
  4465. | |_________^
  4466. |
  4467. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4468. help: add `return` as shown
  4469. |
  4470. 48 ~ return Vertex {
  4471. 49 + edges: vec![],
  4472. 50 + data: Hex::empty(),
  4473. 51 + parents: HashSet::new(),
  4474. 52 + taken: false,
  4475. 53 + }
  4476. |
  4477.  
  4478. error: unnecessary structure name repetition
  4479. --> src/vertex.rs:48:9
  4480. |
  4481. 48 | Vertex {
  4482. | ^^^^^^ help: use the applicable keyword: `Self`
  4483. |
  4484. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self
  4485.  
  4486. error: missing documentation for a module
  4487. --> src/lib.rs:67:1
  4488. |
  4489. 67 | mod xml;
  4490. | ^^^^^^^^
  4491. |
  4492. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  4493.  
  4494. error: docs for function which may panic missing `# Panics` section
  4495. --> src/xml.rs:57:5
  4496. |
  4497. 57 | pub fn to_xml(&self) -> Result<String> {
  4498. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4499. |
  4500. note: first possible panic found here
  4501. --> src/xml.rs:74:17
  4502. |
  4503. 74 | v_node.add_child(e_node).unwrap();
  4504. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4505. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
  4506.  
  4507. error: docs for function returning `Result` missing `# Errors` section
  4508. --> src/xml.rs:57:5
  4509. |
  4510. 57 | pub fn to_xml(&self) -> Result<String> {
  4511. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4512. |
  4513. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  4514.  
  4515. error: missing `#[inline]` for a method
  4516. --> src/xml.rs:57:5
  4517. |
  4518. 57 | / pub fn to_xml(&self) -> Result<String> {
  4519. 58 | | let mut xml = XMLBuilder::new()
  4520. 59 | | .version(XMLVersion::XML1_1)
  4521. 60 | | .encoding("UTF-8".into())
  4522. ... |
  4523. 88 | | Ok(std::str::from_utf8(&writer)?.to_string())
  4524. 89 | | }
  4525. | |_____^
  4526. |
  4527. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
  4528.  
  4529. error: used unwrap or expect in a function that returns result or option
  4530. --> src/xml.rs:57:5
  4531. |
  4532. 57 | / pub fn to_xml(&self) -> Result<String> {
  4533. 58 | | let mut xml = XMLBuilder::new()
  4534. 59 | | .version(XMLVersion::XML1_1)
  4535. 60 | | .encoding("UTF-8".into())
  4536. ... |
  4537. 88 | | Ok(std::str::from_utf8(&writer)?.to_string())
  4538. 89 | | }
  4539. | |_____^
  4540. |
  4541. = help: unwrap and expect should not be used in a function that returns result or option
  4542. note: potential non-recoverable error(s)
  4543. --> src/xml.rs:74:17
  4544. |
  4545. 74 | v_node.add_child(e_node).unwrap();
  4546. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4547. ...
  4548. 78 | / data_node
  4549. 79 | | .add_text(vtx.data.print().replace('-', " "))
  4550. 80 | | .unwrap();
  4551. | |_____________________________^
  4552. 81 | v_node.add_child(data_node).unwrap();
  4553. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4554. 82 | }
  4555. 83 | root.add_child(v_node).unwrap();
  4556. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4557. ...
  4558. 87 | xml.generate(&mut writer).unwrap();
  4559. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4560. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_in_result
  4561.  
  4562. error: missing `return` statement
  4563. --> src/xml.rs:88:9
  4564. |
  4565. 88 | Ok(std::str::from_utf8(&writer)?.to_string())
  4566. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add `return` as shown: `return Ok(std::str::from_utf8(&writer)?.to_string())`
  4567. |
  4568. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4569.  
  4570. error: missing `return` statement
  4571. --> src/xml.rs:66:37
  4572. |
  4573. 66 | .sorted_by_key(|(v, _)| <&u32>::clone(v))
  4574. | ^^^^^^^^^^^^^^^^ help: add `return` as shown: `return <&u32>::clone(v)`
  4575. |
  4576. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4577.  
  4578. error: type of pattern does not match the expression type
  4579. --> src/xml.rs:66:29
  4580. |
  4581. 66 | .sorted_by_key(|(v, _)| <&u32>::clone(v))
  4582. | ^^^^^^
  4583. |
  4584. = help: explicitly match against a `&_` pattern and adjust the enclosed variable bindings
  4585. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
  4586.  
  4587. error: missing `return` statement
  4588. --> src/xml.rs:70:57
  4589. |
  4590. 70 | for e in vtx.edges.iter().sorted_by_key(|e| e.a.clone()) {
  4591. | ^^^^^^^^^^^ help: add `return` as shown: `return e.a.clone()`
  4592. |
  4593. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
  4594.  
  4595. error: used `unwrap()` on a `Result` value
  4596. --> src/xml.rs:74:17
  4597. |
  4598. 74 | v_node.add_child(e_node).unwrap();
  4599. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4600. |
  4601. = help: if this value is an `Err`, it will panic
  4602. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4603.  
  4604. error: used `unwrap()` on a `Result` value
  4605. --> src/xml.rs:78:17
  4606. |
  4607. 78 | / data_node
  4608. 79 | | .add_text(vtx.data.print().replace('-', " "))
  4609. 80 | | .unwrap();
  4610. | |_____________________________^
  4611. |
  4612. = help: if this value is an `Err`, it will panic
  4613. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4614.  
  4615. error: used `unwrap()` on a `Result` value
  4616. --> src/xml.rs:81:17
  4617. |
  4618. 81 | v_node.add_child(data_node).unwrap();
  4619. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4620. |
  4621. = help: if this value is an `Err`, it will panic
  4622. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4623.  
  4624. error: used `unwrap()` on a `Result` value
  4625. --> src/xml.rs:83:13
  4626. |
  4627. 83 | root.add_child(v_node).unwrap();
  4628. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4629. |
  4630. = help: if this value is an `Err`, it will panic
  4631. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4632.  
  4633. error: used `unwrap()` on a `Result` value
  4634. --> src/xml.rs:87:9
  4635. |
  4636. 87 | xml.generate(&mut writer).unwrap();
  4637. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4638. |
  4639. = help: if this value is an `Err`, it will panic
  4640. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
  4641.  
  4642. error: `to_string()` called on a `&str`
  4643. --> src/xml.rs:88:12
  4644. |
  4645. 88 | Ok(std::str::from_utf8(&writer)?.to_string())
  4646. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4647. |
  4648. = help: consider using `.to_owned()`
  4649. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
  4650.  
  4651. error: used import from `std` instead of `core`
  4652. --> src/xml.rs:88:12
  4653. |
  4654. 88 | Ok(std::str::from_utf8(&writer)?.to_string())
  4655. | ^^^^^^^^^^^^^^^^^^^
  4656. |
  4657. = help: consider importing the item from `core`
  4658. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
  4659.  
  4660. error: item in documentation is missing backticks
  4661. --> src/lib.rs:82:47
  4662. |
  4663. 82 | /// A struct that represents a Surging Object DiGraph (SODG).
  4664. | ^^^^^^^
  4665. |
  4666. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
  4667. help: try
  4668. |
  4669. 82 | /// A struct that represents a Surging Object `DiGraph` (SODG).
  4670. | ~~~~~~~~~
  4671.  
  4672. error: docs for function returning `Result` missing `# Errors` section
  4673. --> src/lib.rs:141:5
  4674. |
  4675. 141 | fn re(&self, v: u32, a: &str) -> Result<String>;
  4676. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4677. |
  4678. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
  4679.  
  4680. error: exported structs should not be exhaustive
  4681. --> src/lib.rs:147:1
  4682. |
  4683. 147 | pub struct DeadRelay {}
  4684. | ^^^^^^^^^^^^^^^^^^^^^^^
  4685. |
  4686. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#exhaustive_structs
  4687. = note: `#[deny(clippy::exhaustive_structs)]` implied by `#[deny(warnings)]`
  4688. help: try adding #[non_exhaustive]
  4689. |
  4690. 147 | #[non_exhaustive]
  4691. |
  4692.  
  4693. error: missing documentation for a struct field
  4694. --> src/lib.rs:158:5
  4695. |
  4696. 158 | lambda: fn(u32, &str) -> Result<String>,
  4697. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  4698. |
  4699. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  4700.  
  4701. error: missing documentation for a struct field
  4702. --> src/lib.rs:163:5
  4703. |
  4704. 163 | s: String,
  4705. | ^^^^^^^^^
  4706. |
  4707. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
  4708.  
  4709. error: `clippy::restriction` is not meant to be enabled as a group
  4710. --> src/lib.rs:43:1
  4711. |
  4712. 43 | clippy::restriction,
  4713. | ^^^^^^^^^^^^^^^^^^^
  4714. |
  4715. = help: enable the restriction lints you need individually
  4716. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#blanket_clippy_restriction_lints
  4717. = note: `#[deny(clippy::blanket_clippy_restriction_lints)]` implied by `#[deny(warnings)]`
  4718.  
  4719. error: multiple implementations of this structure
  4720. --> src/ctors.rs:28:1
  4721. |
  4722. 28 | / impl Sodg {
  4723. 29 | | /// Make an empty [`Sodg`], with no vertices and no edges.
  4724. 30 | | pub fn empty() -> Self {
  4725. 31 | | let mut g = Sodg {
  4726. ... |
  4727. 129 | | }
  4728. 130 | | }
  4729. | |_^
  4730. |
  4731. note: first implementation here
  4732. --> src/alerts.rs:31:1
  4733. |
  4734. 31 | / impl Sodg {
  4735. 32 | | /// Attach a new alert to this graph.
  4736. 33 | | ///
  4737. 34 | | /// For example, you don't want
  4738. ... |
  4739. 87 | | }
  4740. 88 | | }
  4741. | |_^
  4742. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4743. = note: `#[deny(clippy::multiple_inherent_impl)]` implied by `#[deny(warnings)]`
  4744.  
  4745. error: multiple implementations of this structure
  4746. --> src/debug.rs:50:1
  4747. |
  4748. 50 | / impl Sodg {
  4749. 51 | | /// Print a single vertex to a string, which can be used for
  4750. 52 | | /// logging and debugging.
  4751. 53 | | pub fn v_print(&self, v: u32) -> String {
  4752. ... |
  4753. 65 | | }
  4754. 66 | | }
  4755. | |_^
  4756. |
  4757. note: first implementation here
  4758. --> src/alerts.rs:31:1
  4759. |
  4760. 31 | / impl Sodg {
  4761. 32 | | /// Attach a new alert to this graph.
  4762. 33 | | ///
  4763. 34 | | /// For example, you don't want
  4764. ... |
  4765. 87 | | }
  4766. 88 | | }
  4767. | |_^
  4768. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4769.  
  4770. error: multiple implementations of this structure
  4771. --> src/dot.rs:24:1
  4772. |
  4773. 24 | / impl Sodg {
  4774. 25 | | /// Print SODG as a DOT graph.
  4775. 26 | | ///
  4776. 27 | | /// For example, for this code:
  4777. ... |
  4778. 99 | | }
  4779. 100 | | }
  4780. | |_^
  4781. |
  4782. note: first implementation here
  4783. --> src/alerts.rs:31:1
  4784. |
  4785. 31 | / impl Sodg {
  4786. 32 | | /// Attach a new alert to this graph.
  4787. 33 | | ///
  4788. 34 | | /// For example, you don't want
  4789. ... |
  4790. 87 | | }
  4791. 88 | | }
  4792. | |_^
  4793. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4794.  
  4795. error: multiple implementations of this structure
  4796. --> src/find.rs:85:1
  4797. |
  4798. 85 | / impl Sodg {
  4799. 86 | | /// Find a vertex in the Sodg by its locator using a [`Relay`]
  4800. 87 | | /// to provide alternative edge names, if the desired ones are not found.
  4801. 88 | | ///
  4802. ... |
  4803. 218 | | }
  4804. 219 | | }
  4805. | |_^
  4806. |
  4807. note: first implementation here
  4808. --> src/alerts.rs:31:1
  4809. |
  4810. 31 | / impl Sodg {
  4811. 32 | | /// Attach a new alert to this graph.
  4812. 33 | | ///
  4813. 34 | | /// For example, you don't want
  4814. ... |
  4815. 87 | | }
  4816. 88 | | }
  4817. | |_^
  4818. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4819.  
  4820. error: multiple implementations of this structure
  4821. --> src/gc.rs:12:1
  4822. |
  4823. 12 | / impl Sodg {
  4824. 13 | | /// Attempt to collect the vertex (delete it from the graph).
  4825. 14 | | ///
  4826. 15 | | /// If there are no edges leading to it, then it is deleted and
  4827. ... |
  4828. 59 | | }
  4829. 60 | | }
  4830. | |_^
  4831. |
  4832. note: first implementation here
  4833. --> src/alerts.rs:31:1
  4834. |
  4835. 31 | / impl Sodg {
  4836. 32 | | /// Attach a new alert to this graph.
  4837. 33 | | ///
  4838. 34 | | /// For example, you don't want
  4839. ... |
  4840. 87 | | }
  4841. 88 | | }
  4842. | |_^
  4843. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4844.  
  4845. error: multiple implementations of this structure
  4846. --> src/inspect.rs:27:1
  4847. |
  4848. 27 | / impl Sodg {
  4849. 28 | | /// Find an object by the provided locator and print its tree
  4850. 29 | | /// of sub-objects and edges.
  4851. 30 | | ///
  4852. ... |
  4853. 76 | | }
  4854. 77 | | }
  4855. | |_^
  4856. |
  4857. note: first implementation here
  4858. --> src/alerts.rs:31:1
  4859. |
  4860. 31 | / impl Sodg {
  4861. 32 | | /// Attach a new alert to this graph.
  4862. 33 | | ///
  4863. 34 | | /// For example, you don't want
  4864. ... |
  4865. 87 | | }
  4866. 88 | | }
  4867. | |_^
  4868. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4869.  
  4870. error: multiple implementations of this structure
  4871. --> src/merge.rs:26:1
  4872. |
  4873. 26 | / impl Sodg {
  4874. 27 | | /// Merge another graph into the current one.
  4875. 28 | | ///
  4876. 29 | | /// It is expected that both graphs are trees. The `left` vertex is expected
  4877. ... |
  4878. 80 | | }
  4879. 81 | | }
  4880. | |_^
  4881. |
  4882. note: first implementation here
  4883. --> src/alerts.rs:31:1
  4884. |
  4885. 31 | / impl Sodg {
  4886. 32 | | /// Attach a new alert to this graph.
  4887. 33 | | ///
  4888. 34 | | /// For example, you don't want
  4889. ... |
  4890. 87 | | }
  4891. 88 | | }
  4892. | |_^
  4893. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4894.  
  4895. error: multiple implementations of this structure
  4896. --> src/misc.rs:23:1
  4897. |
  4898. 23 | / impl Sodg {
  4899. 24 | | /// Get total number of vertices in the graph.
  4900. 25 | | pub fn len(&self) -> usize {
  4901. 26 | | self.vertices.len()
  4902. ... |
  4903. 44 | | }
  4904. 45 | | }
  4905. | |_^
  4906. |
  4907. note: first implementation here
  4908. --> src/alerts.rs:31:1
  4909. |
  4910. 31 | / impl Sodg {
  4911. 32 | | /// Attach a new alert to this graph.
  4912. 33 | | ///
  4913. 34 | | /// For example, you don't want
  4914. ... |
  4915. 87 | | }
  4916. 88 | | }
  4917. | |_^
  4918. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4919.  
  4920. error: multiple implementations of this structure
  4921. --> src/next.rs:23:1
  4922. |
  4923. 23 | / impl Sodg {
  4924. 24 | | /// Get next unique ID of a vertex.
  4925. 25 | | ///
  4926. 26 | | /// This ID will never be returned by `next()` again. Also, this ID will not
  4927. ... |
  4928. 37 | | }
  4929. 38 | | }
  4930. | |_^
  4931. |
  4932. note: first implementation here
  4933. --> src/alerts.rs:31:1
  4934. |
  4935. 31 | / impl Sodg {
  4936. 32 | | /// Attach a new alert to this graph.
  4937. 33 | | ///
  4938. 34 | | /// For example, you don't want
  4939. ... |
  4940. 87 | | }
  4941. 88 | | }
  4942. | |_^
  4943. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4944.  
  4945. error: multiple implementations of this structure
  4946. --> src/ops.rs:29:1
  4947. |
  4948. 29 | / impl Sodg {
  4949. 30 | | /// Add a new vertex `v1` to itself.
  4950. 31 | | ///
  4951. 32 | | /// For example:
  4952. ... |
  4953. 230 | | }
  4954. 231 | | }
  4955. | |_^
  4956. |
  4957. note: first implementation here
  4958. --> src/alerts.rs:31:1
  4959. |
  4960. 31 | / impl Sodg {
  4961. 32 | | /// Attach a new alert to this graph.
  4962. 33 | | ///
  4963. 34 | | /// For example, you don't want
  4964. ... |
  4965. 87 | | }
  4966. 88 | | }
  4967. | |_^
  4968. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4969.  
  4970. error: multiple implementations of this structure
  4971. --> src/serialization.rs:29:1
  4972. |
  4973. 29 | / impl Sodg {
  4974. 30 | | /// Save the entire [`Sodg`] into a binary file.
  4975. 31 | | ///
  4976. 32 | | /// The entire [`Sodg`] can be restored from the file.
  4977. ... |
  4978. 63 | | }
  4979. 64 | | }
  4980. | |_^
  4981. |
  4982. note: first implementation here
  4983. --> src/alerts.rs:31:1
  4984. |
  4985. 31 | / impl Sodg {
  4986. 32 | | /// Attach a new alert to this graph.
  4987. 33 | | ///
  4988. 34 | | /// For example, you don't want
  4989. ... |
  4990. 87 | | }
  4991. 88 | | }
  4992. | |_^
  4993. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  4994.  
  4995. error: multiple implementations of this structure
  4996. --> src/slice.rs:26:1
  4997. |
  4998. 26 | / impl Sodg {
  4999. 27 | | /// Take a slice of the graph, keeping only the vertex specified
  5000. 28 | | /// by the locator and its kids, recursively found in the entire graph.
  5001. 29 | | pub fn slice(&mut self, loc: &str) -> Result<Sodg> {
  5002. ... |
  5003. 73 | | }
  5004. 74 | | }
  5005. | |_^
  5006. |
  5007. note: first implementation here
  5008. --> src/alerts.rs:31:1
  5009. |
  5010. 31 | / impl Sodg {
  5011. 32 | | /// Attach a new alert to this graph.
  5012. 33 | | ///
  5013. 34 | | /// For example, you don't want
  5014. ... |
  5015. 87 | | }
  5016. 88 | | }
  5017. | |_^
  5018. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  5019.  
  5020. error: multiple implementations of this structure
  5021. --> src/xml.rs:26:1
  5022. |
  5023. 26 | / impl Sodg {
  5024. 27 | | /// Make XML graph.
  5025. 28 | | ///
  5026. 29 | | /// For example, for this code:
  5027. ... |
  5028. 89 | | }
  5029. 90 | | }
  5030. | |_^
  5031. |
  5032. note: first implementation here
  5033. --> src/alerts.rs:31:1
  5034. |
  5035. 31 | / impl Sodg {
  5036. 32 | | /// Attach a new alert to this graph.
  5037. 33 | | ///
  5038. 34 | | /// For example, you don't want
  5039. ... |
  5040. 87 | | }
  5041. 88 | | }
  5042. | |_^
  5043. = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_inherent_impl
  5044.  
  5045. error: could not compile `sodg` due to 499 previous errors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement