11//! Create markdown tables for [Locatarr](https://github.com/Locatarr/Locatarr)
22
3+ #![ warn( clippy:: pedantic) ]
4+
35use itertools:: Itertools ;
46
57use models:: { Application , Applications } ;
@@ -10,26 +12,27 @@ pub mod models;
1012///
1113/// The resulting table is the minimum viable table and is not formatted in any way.
1214pub fn generate_md_table ( apps : & Applications ) -> String {
13- "| **Application** | **Description** | **Github** | **Reddit** |\n |-|-|-|-|\n " . to_owned ( ) +
14- & apps. applications
15- . iter ( )
16- . sorted ( )
17- . map ( generate_md_row)
18- . join ( "\n " )
15+ "| **Application** | **Description** | **Github** | **Reddit** |\n |-|-|-|-|\n " . to_owned ( )
16+ + & apps
17+ . applications
18+ . iter ( )
19+ . sorted ( )
20+ . map ( generate_md_row)
21+ . join ( "\n " )
1922}
2023
2124/// Create one markdown table row from a single [Application]
2225///
23- /// Copies the [Application::name] and [Application::description] fields in, and transforms [Application::github_slug] and
24- /// [Application::subreddit] into proper markdown links.
26+ /// Copies the [` Application::name` ] and [` Application::description` ] fields in, and transforms [` Application::github_slug` ] and
27+ /// [` Application::subreddit` ] into proper markdown links.
2528fn generate_md_row ( app : & Application ) -> String {
2629 let github_link = match & app. github_slug {
27- Some ( slug) => format ! ( "[{}](https://github.com/{})" , slug , slug ) ,
30+ Some ( slug) => format ! ( "[{slug }](https://github.com/{slug })" ) ,
2831 None => String :: new ( ) ,
2932 } ;
3033
3134 let subreddit_link = match & app. subreddit {
32- Some ( sub) => format ! ( "[{}](https://reddit.com/{})" , sub , sub ) ,
35+ Some ( sub) => format ! ( "[{sub }](https://reddit.com/{sub })" ) ,
3336 None => String :: new ( ) ,
3437 } ;
3538
0 commit comments