File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -172,13 +172,15 @@ impl UsbipdGui {
172172 . unwrap_or_else ( || "Unknown Device" . to_string ( ) ) ,
173173 ) ;
174174 // if len > 32, truncate and add bus id
175- if description. len ( ) > 32 { // @todo use settings replace magic number
176- description . truncate ( 32 ) ;
175+ if description. len ( ) > 32 {
176+ // @todo use settings replace magic number
177177 let bus_id = device
178178 . bus_id
179179 . clone ( )
180180 . unwrap_or_else ( || "Unknown Bus" . to_string ( ) ) ;
181- description. push_str ( & format ! ( "..(Bus:{})" , bus_id) ) ;
181+ let bus_id_show = & format ! ( "..(Bus:{})" , bus_id) ; // not think it will be longer than 32
182+ description. truncate ( 32 - bus_id_show. len ( ) ) ;
183+ description. push_str ( bus_id_show) ;
182184 }
183185 if device. is_bound ( ) {
184186 let menu_item = self
You can’t perform that action at this time.
0 commit comments