@@ -19,26 +19,26 @@ pub trait NodeVersion {
1919 fn version ( & self ) -> & Version ;
2020}
2121
22- impl PartialEq < Self > for dyn NodeVersion {
22+ impl PartialEq for dyn NodeVersion {
2323 fn eq ( & self , other : & Self ) -> bool {
2424 self . version ( ) . eq ( other. version ( ) )
2525 }
2626}
2727
2828impl Eq for dyn NodeVersion { }
2929
30- impl PartialOrd < Self > for dyn NodeVersion {
31- fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
32- Some ( self . version ( ) . cmp ( other. version ( ) ) )
33- }
34- }
35-
3630impl Ord for dyn NodeVersion {
3731 fn cmp ( & self , other : & Self ) -> Ordering {
3832 self . version ( ) . cmp ( other. version ( ) )
3933 }
4034}
4135
36+ impl PartialOrd for dyn NodeVersion {
37+ fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
38+ Some ( self . cmp ( other) )
39+ }
40+ }
41+
4242pub fn parse_range ( value : & str ) -> Result < Range > {
4343 Range :: parse ( value) . context ( value. to_string ( ) )
4444}
@@ -141,9 +141,9 @@ impl OnlineNodeVersion {
141141 }
142142}
143143
144- impl ToString for OnlineNodeVersion {
145- fn to_string ( & self ) -> String {
146- self . version . to_string ( )
144+ impl std :: fmt :: Display for OnlineNodeVersion {
145+ fn fmt ( & self , f : & mut std :: fmt :: Formatter < ' _ > ) -> std :: fmt :: Result {
146+ write ! ( f , "{}" , self . version)
147147 }
148148}
149149
@@ -268,9 +268,9 @@ impl InstalledNodeVersion {
268268 }
269269}
270270
271- impl ToString for InstalledNodeVersion {
272- fn to_string ( & self ) -> String {
273- self . version . to_string ( )
271+ impl std :: fmt :: Display for InstalledNodeVersion {
272+ fn fmt ( & self , f : & mut std :: fmt :: Formatter < ' _ > ) -> std :: fmt :: Result {
273+ write ! ( f , "{}" , self . version)
274274 }
275275}
276276
0 commit comments