File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ export default class Version extends Model {
2929 */
3030 @attr rust_version ;
3131
32+ /**
33+ * The Rust edition required to compile this crate version.
34+ * @type {string | null }
35+ */
36+ @attr edition ;
37+
3238 /** @type {boolean | null } */
3339 @attr has_lib ;
3440 /** @type {string[] | null } */
@@ -46,8 +52,14 @@ export default class Version extends Model {
4652
4753 get msrv ( ) {
4854 let rustVersion = this . rust_version ;
49- // add `.0` suffix if the `rust-version` field only has two version components
50- return / ^ [ ^ . ] + \. [ ^ . ] + $ / . test ( rustVersion ) ? `${ rustVersion } .0` : rustVersion ;
55+ if ( rustVersion ) {
56+ // add `.0` suffix if the `rust-version` field only has two version components
57+ return / ^ [ ^ . ] + \. [ ^ . ] + $ / . test ( rustVersion ) ? `${ rustVersion } .0` : rustVersion ;
58+ } else if ( this . edition === '2018' ) {
59+ return '1.31.0' ;
60+ } else if ( this . edition === '2021' ) {
61+ return '1.56.0' ;
62+ }
5163 }
5264
5365 get isNew ( ) {
You can’t perform that action at this time.
0 commit comments