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 87
87
</ div >
88
88
< script >
89
89
const RusfmtTagsUrl = 'https://api.github.com/repos/rust-lang/rustfmt/tags' ;
90
+ const RustfmtLatestUrl = 'https://api.github.com/repos/rust-lang/rustfmt/releases/latest' ;
90
91
const UrlHash = window . location . hash . replace ( / ^ # / , '' ) ;
91
92
const queryParams = new URLSearchParams ( window . location . search ) ;
92
93
const searchParam = queryParams . get ( 'search' ) ;
112
113
scrolledOnce : false ,
113
114
} ,
114
115
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
+ } ,
115
126
async outputHtml ( ) {
116
127
if ( this . version !== this . oldVersion ) {
117
128
const ConfigurationMdUrl =
You can’t perform that action at this time.
0 commit comments