File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ fn main() {
2929 . load (" /bin/cat" )
3030 . expect (" Couldn't open `/bin/cat`" );
3131
32- println! (" Filename : `{}`" , bv . file () . filename ());
32+ println! (" File : `{}`" , bv . file ());
3333 println! (" File size: `{:#x}`" , bv . len ());
3434 println! (" Function count: {}" , bv . functions (). len ());
3535
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ fn main() {
1212 . load ( "/bin/cat" )
1313 . expect ( "Couldn't open `/bin/cat`" ) ;
1414
15- println ! ( "Filename : `{}`" , bv. file( ) . filename ( ) ) ;
15+ println ! ( "File : `{}`" , bv. file( ) ) ;
1616 println ! ( "File size: `{:#x}`" , bv. len( ) ) ;
1717 println ! ( "Function count: {}" , bv. functions( ) . len( ) ) ;
1818
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ use binaryninjacore_sys::{
2727} ;
2828use binaryninjacore_sys:: { BNCreateDatabaseWithProgress , BNOpenExistingDatabaseWithProgress } ;
2929use std:: ffi:: c_void;
30- use std:: fmt:: Debug ;
30+ use std:: fmt:: { Debug , Display , Formatter } ;
3131use std:: path:: Path ;
3232
3333use crate :: progress:: ProgressCallback ;
@@ -375,7 +375,7 @@ impl FileMetadata {
375375}
376376
377377impl Debug for FileMetadata {
378- fn fmt ( & self , f : & mut std :: fmt :: Formatter < ' _ > ) -> std:: fmt:: Result {
378+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
379379 f. debug_struct ( "FileMetadata" )
380380 . field ( "filename" , & self . filename ( ) )
381381 . field ( "session_id" , & self . session_id ( ) )
@@ -388,6 +388,12 @@ impl Debug for FileMetadata {
388388 }
389389}
390390
391+ impl Display for FileMetadata {
392+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> std:: fmt:: Result {
393+ f. write_str ( & self . filename ( ) )
394+ }
395+ }
396+
391397unsafe impl Send for FileMetadata { }
392398unsafe impl Sync for FileMetadata { }
393399
You can’t perform that action at this time.
0 commit comments