@@ -88,8 +88,8 @@ pub struct Arguments {
8888 downlink_delay : Option < Delay > ,
8989
9090 /// Uplink bandwidth
91- #[ arg( long, global = true , value_name = "Bandwidth" , group = "uplink-bw" ) ]
92- uplink_bandwidth : Option < u64 > ,
91+ #[ arg( long, global = true , value_name = "Bandwidth" , group = "uplink-bw" , value_parser = human_bandwidth :: parse_bandwidth ) ]
92+ uplink_bandwidth : Option < Bandwidth > ,
9393 /// Uplink trace file
9494 #[ arg( long, global = true , value_name = "Trace File" , group = "uplink-bw" ) ]
9595 uplink_trace : Option < String > ,
@@ -107,8 +107,8 @@ pub struct Arguments {
107107 uplink_queue_args : Option < String > ,
108108
109109 /// Downlink bandwidth
110- #[ arg( long, global = true , value_name = "Bandwidth" , group = "downlink-bw" ) ]
111- downlink_bandwidth : Option < u64 > ,
110+ #[ arg( long, global = true , value_name = "Bandwidth" , group = "downlink-bw" , value_parser = human_bandwidth :: parse_bandwidth ) ]
111+ downlink_bandwidth : Option < Bandwidth > ,
112112 /// Downlink trace file
113113 #[ arg( long, global = true , value_name = "Trace File" , group = "downlink-bw" ) ]
114114 downlink_trace : Option < String > ,
@@ -402,7 +402,6 @@ fn main() -> ExitCode {
402402 let mut downlink_count = 0 ;
403403
404404 if let Some ( bandwidth) = opts. uplink_bandwidth {
405- let bandwidth = Bandwidth :: from_bps ( bandwidth) ;
406405 let device_config = match opts. uplink_queue {
407406 Some ( QueueType :: Infinite ) | None => {
408407 DeviceBuildConfig :: Bw ( BwDeviceBuildConfig :: Infinite (
@@ -465,7 +464,6 @@ fn main() -> ExitCode {
465464 }
466465
467466 if let Some ( bandwidth) = opts. downlink_bandwidth {
468- let bandwidth = Bandwidth :: from_bps ( bandwidth) ;
469467 let device_config = match opts. downlink_queue {
470468 Some ( QueueType :: Infinite ) | None => {
471469 DeviceBuildConfig :: Bw ( BwDeviceBuildConfig :: Infinite (
0 commit comments