@@ -9,18 +9,17 @@ use crate::widgets::StatefulList;
99use copypasta_ext:: display:: DisplayServer as ClipboardDisplayServer ;
1010use copypasta_ext:: ClipboardProviderExt ;
1111use enum_iterator:: Sequence ;
12+ use ratatui:: layout:: { Alignment , Constraint , Direction , Layout , Rect } ;
13+ use ratatui:: style:: Style as TuiStyle ;
14+ use ratatui:: text:: { Line , Span , Text } ;
15+ use ratatui:: widgets:: {
16+ Block as TuiBlock , Borders , Clear , List , ListItem , Paragraph , Row , Table , Wrap ,
17+ } ;
18+ use ratatui:: Frame ;
1219use std:: fmt:: { Debug , Display , Formatter } ;
1320use std:: slice:: Iter ;
1421use std:: sync:: mpsc:: Sender ;
1522use termion:: event:: Key ;
16- use tui:: backend:: Backend ;
17- use tui:: layout:: { Alignment , Constraint , Direction , Layout , Rect } ;
18- use tui:: style:: Style as TuiStyle ;
19- use tui:: text:: { Line , Span , Text } ;
20- use tui:: widgets:: {
21- Block as TuiBlock , Borders , Clear , List , ListItem , Paragraph , Row , Table , Wrap ,
22- } ;
23- use tui:: Frame ;
2423use unicode_width:: UnicodeWidthStr ;
2524
2625/* Table header of the module table */
@@ -325,14 +324,12 @@ impl App {
325324 * @param area
326325 * @param kernel
327326 */
328- pub fn draw_dynamic_block < B > (
327+ pub fn draw_dynamic_block (
329328 & mut self ,
330- frame : & mut Frame < ' _ , B > ,
329+ frame : & mut Frame ,
331330 area : Rect ,
332331 kernel : & mut Kernel ,
333- ) where
334- B : Backend ,
335- {
332+ ) {
336333 match self . block_index {
337334 0 => self . draw_kernel_modules ( frame, area, & mut kernel. modules ) ,
338335 1 => self . draw_module_info ( frame, area, & mut kernel. modules ) ,
@@ -352,14 +349,12 @@ impl App {
352349 * @param area
353350 * @param tx
354351 */
355- pub fn draw_user_input < B > (
352+ pub fn draw_user_input (
356353 & self ,
357- frame : & mut Frame < ' _ , B > ,
354+ frame : & mut Frame ,
358355 area : Rect ,
359356 tx : & Sender < Event < Key > > ,
360- ) where
361- B : Backend ,
362- {
357+ ) {
363358 frame. render_widget (
364359 Paragraph :: new ( Span :: raw ( self . input_query . to_string ( ) ) )
365360 . block (
@@ -399,14 +394,7 @@ impl App {
399394 * @param area
400395 * @param info
401396 */
402- pub fn draw_kernel_info < B > (
403- & self ,
404- frame : & mut Frame < ' _ , B > ,
405- area : Rect ,
406- info : & [ String ] ,
407- ) where
408- B : Backend ,
409- {
397+ pub fn draw_kernel_info ( & self , frame : & mut Frame , area : Rect , info : & [ String ] ) {
410398 frame. render_widget (
411399 Paragraph :: new ( Span :: raw ( & info[ 1 ] ) )
412400 . block (
@@ -436,14 +424,12 @@ impl App {
436424 * @param area
437425 * @param kernel_modules
438426 */
439- pub fn draw_kernel_modules < B > (
427+ pub fn draw_kernel_modules (
440428 & mut self ,
441- frame : & mut Frame < ' _ , B > ,
429+ frame : & mut Frame ,
442430 area : Rect ,
443431 kernel_modules : & mut KernelModules < ' _ > ,
444- ) where
445- B : Backend ,
446- {
432+ ) {
447433 /* Filter the module list depending on the input query. */
448434 let mut kernel_module_list = kernel_modules. default_list . clone ( ) ;
449435 if ( self . input_mode == InputMode :: None
@@ -540,14 +526,12 @@ impl App {
540526 * @param frame
541527 * @param area
542528 */
543- pub fn draw_options_menu < B > (
529+ pub fn draw_options_menu (
544530 & mut self ,
545- frame : & mut Frame < ' _ , B > ,
531+ frame : & mut Frame ,
546532 area : Rect ,
547533 kernel_modules : & mut KernelModules < ' _ > ,
548- ) where
549- B : Backend ,
550- {
534+ ) {
551535 let block_title = format ! (
552536 "Options ({})" ,
553537 kernel_modules. list[ kernel_modules. index] [ 0 ]
@@ -626,14 +610,12 @@ impl App {
626610 * @param area
627611 * @param kernel_modules
628612 */
629- pub fn draw_module_info < B > (
613+ pub fn draw_module_info (
630614 & self ,
631- frame : & mut Frame < ' _ , B > ,
615+ frame : & mut Frame ,
632616 area : Rect ,
633617 kernel_modules : & mut KernelModules < ' _ > ,
634- ) where
635- B : Backend ,
636- {
618+ ) {
637619 frame. render_widget (
638620 Paragraph :: new ( kernel_modules. current_info . get ( ) )
639621 . block (
@@ -676,14 +658,12 @@ impl App {
676658 * @param area
677659 * @param kernel_logs
678660 */
679- pub fn draw_kernel_activities < B > (
661+ pub fn draw_kernel_activities (
680662 & self ,
681- frame : & mut Frame < ' _ , B > ,
663+ frame : & mut Frame ,
682664 area : Rect ,
683665 kernel_logs : & mut KernelLogs ,
684- ) where
685- B : Backend ,
686- {
666+ ) {
687667 frame. render_widget (
688668 Paragraph :: new ( StyledText :: default ( ) . stylize_data (
689669 kernel_logs. select ( area. height , 2 ) ,
@@ -715,8 +695,8 @@ mod tests {
715695 use crate :: kernel:: info;
716696 use crate :: kernel:: lkm:: ListArgs ;
717697 use clap:: ArgMatches ;
718- use tui :: backend:: TestBackend ;
719- use tui :: Terminal ;
698+ use ratatui :: backend:: TestBackend ;
699+ use ratatui :: Terminal ;
720700 #[ test]
721701 fn test_app ( ) {
722702 let args = ArgMatches :: default ( ) ;
0 commit comments