File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 33import shutil
44from io import StringIO
55from pathlib import Path
6- from typing import Optional
6+ from typing import Optional , cast
77
88from pydantic .dataclasses import dataclass
99from rich .console import Console
@@ -79,11 +79,11 @@ def to_console_string(self) -> str:
7979 f"{ detail .expected_new_timing } " ,
8080 f"{ detail .speedup_percent :.2f} %"
8181 )
82-
83- # Render table to string - using actual terminal width
84- console = Console (file = StringIO () , width = terminal_width )
82+ # Convert table to string
83+ string_buffer = StringIO ()
84+ console = Console (file = string_buffer , width = terminal_width )
8585 console .print (table )
86- benchmark_info = console .file .getvalue () + "\n "
86+ benchmark_info = cast ( StringIO , console .file ) .getvalue () + "\n " # Cast for mypy
8787
8888 return (
8989 f"Optimized { self .function_name } in { self .file_path } \n "
You can’t perform that action at this time.
0 commit comments