File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 8787 </ div >
8888 < script >
8989 const RusfmtTagsUrl = 'https://api.github.com/repos/rust-lang/rustfmt/tags' ;
90+ const RustfmtLatestUrl = 'https://api.github.com/repos/rust-lang/rustfmt/releases/latest' ;
9091 const UrlHash = window . location . hash . replace ( / ^ # / , '' ) ;
9192 const queryParams = new URLSearchParams ( window . location . search ) ;
9293 const searchParam = queryParams . get ( 'search' ) ;
112113 scrolledOnce : false ,
113114 } ,
114115 asyncComputed : {
116+ async updateVersion ( ) {
117+ let latest ;
118+ try {
119+ latest = ( await axios . get ( RustfmtLatestUrl ) ) . data ;
120+ } catch ( err ) {
121+ console . log ( err ) ;
122+ return ;
123+ }
124+ this . version = latest . name ;
125+ } ,
115126 async outputHtml ( ) {
116127 if ( this . version !== this . oldVersion ) {
117128 const ConfigurationMdUrl =
You can’t perform that action at this time.
0 commit comments