@@ -128,7 +128,7 @@ impl TemplateValue {
128128 Self :: Url ( _) => {
129129 let url = self . name ( ) ?;
130130 let url = Url :: parse ( & url)
131- . with_context ( || format ! ( "[Ignore Template] Invalid URL: {}" , url ) ) ?;
131+ . with_context ( || format ! ( "[Ignore Template] Invalid URL: {url}" ) ) ?;
132132 Ok ( url. to_string ( ) )
133133 }
134134 Self :: File ( _) => {
@@ -143,33 +143,31 @@ impl TemplateValue {
143143 }
144144 Self :: GitHubRepo ( _) => {
145145 let repo = self . name ( ) ?;
146- let url = format ! ( "{}/{}" , GITHUB_RAW , repo ) ;
146+ let url = format ! ( "{GITHUB_RAW }/{repo}" ) ;
147147 Ok ( url)
148148 }
149149 Self :: GitHubGlobal ( _) => {
150150 let repo = self . name ( ) ?;
151151 let url = format ! (
152- "{}/github/gitignore/main/Global/{}.gitignore" ,
153- GITHUB_RAW , repo
152+ "{GITHUB_RAW}/github/gitignore/main/Global/{repo}.gitignore"
154153 ) ;
155154 Ok ( url)
156155 }
157156 Self :: GitHubCommunity ( _) => {
158157 let repo = self . name ( ) ?;
159158 let url = format ! (
160- "{}/github/gitignore/main/community/{}.gitignore" ,
161- GITHUB_RAW , repo
159+ "{GITHUB_RAW}/github/gitignore/main/community/{repo}.gitignore"
162160 ) ;
163161 Ok ( url)
164162 }
165163 Self :: GitHub ( _) => {
166164 let repo = self . name ( ) ?;
167- let url = format ! ( "{}/github/gitignore/main/{}.gitignore" , GITHUB_RAW , repo ) ;
165+ let url = format ! ( "{GITHUB_RAW }/github/gitignore/main/{repo }.gitignore" ) ;
168166 Ok ( url)
169167 }
170168 Self :: TopTal ( _) => {
171169 let name = self . name ( ) ?;
172- let url = format ! ( "{}/{}" , TOPTAL_API , name ) ;
170+ let url = format ! ( "{TOPTAL_API }/{name}" ) ;
173171 Ok ( url)
174172 }
175173 }
@@ -217,7 +215,7 @@ impl Template {
217215 TemplateValue :: File ( _) => {
218216 let path = self . value . url ( ) ?;
219217 let content = fs:: read_to_string ( & path) . with_context ( || {
220- format ! ( "Failed to read ignore file template at path\n {}" , path )
218+ format ! ( "Failed to read ignore file template at path\n {path}" )
221219 } ) ?;
222220 Ok ( content)
223221 }
@@ -229,11 +227,11 @@ impl Template {
229227 let content: String = http ( ) . get ( & url)
230228 . call ( )
231229 . with_context ( || {
232- format ! ( "Failed to fetch ignore template at URL. The template might not exist...\n {}" , url )
230+ format ! ( "Failed to fetch ignore template at URL. The template might not exist...\n {url}" )
233231 } ) ?
234232 . into_string ( )
235233 . with_context ( || {
236- format ! ( "Failed to parse response when fetching ignore template at URL\n {}" , url )
234+ format ! ( "Failed to parse response when fetching ignore template at URL\n {url}" )
237235 } ) ?;
238236 let content = content. trim ( ) ;
239237 TemplateCache :: set ( & url, content) ?;
0 commit comments