File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use crate::common::{
33 VizUdpServer , samples_from_ne_bytes, samples_to_ne_bytes,
44} ;
55use std:: {
6+ fmt:: Display ,
67 net:: { SocketAddr , ToSocketAddrs } ,
78 process:: { Child , Command } ,
89} ;
@@ -13,13 +14,14 @@ pub enum OscilloscopeStyle {
1314 TimeDomain ,
1415 TimeDomainStereo ,
1516}
16- impl ToString for OscilloscopeStyle {
17- fn to_string ( & self ) -> String {
17+
18+ impl Display for OscilloscopeStyle {
19+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
1820 match self {
19- OscilloscopeStyle :: Xy => format ! ( "xy" ) ,
20- OscilloscopeStyle :: TimeDomain => format ! ( "time-domain" ) ,
21+ OscilloscopeStyle :: Xy => write ! ( f , "xy" ) ,
22+ OscilloscopeStyle :: TimeDomain => write ! ( f , "time-domain" ) ,
2123 OscilloscopeStyle :: TimeDomainStereo => {
22- format ! ( "time-domain-stereo" )
24+ write ! ( f , "time-domain-stereo" )
2325 }
2426 }
2527 }
You can’t perform that action at this time.
0 commit comments