File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,13 @@ pub(crate) fn copy_selected_code_to_clipboard(app: &mut App) -> String {
4242 match app. table . state . selected ( ) {
4343 Some ( selected) => match app. table . items . get ( selected) {
4444 Some ( element) => match element. values . get ( 3 ) {
45- Some ( otp_code) => {
46- if let Ok ( result) = copy_string_to_clipboard ( otp_code) {
47- match result {
48- CopyType :: Native => "Copied!" . to_string ( ) ,
49- CopyType :: OSC52 => "Remote copied!" . to_string ( ) ,
50- }
51- } else {
52- "Cannot copy" . to_string ( )
53- }
54- }
45+ Some ( otp_code) => match copy_string_to_clipboard ( otp_code) {
46+ Ok ( result) => match result {
47+ CopyType :: Native => "Copied!" . to_string ( ) ,
48+ CopyType :: OSC52 => "Remote copied!" . to_string ( ) ,
49+ } ,
50+ _ => "Cannot copy" . to_string ( ) ,
51+ } ,
5552 None => "Cannot get OTP Code column" . to_string ( ) ,
5653 } ,
5754 None => format ! ( "Cannot fetch element from index: {selected}" ) ,
Original file line number Diff line number Diff line change @@ -73,12 +73,15 @@ fn main() -> AppResult<()> {
7373 } ;
7474
7575 let error_code = if reowned_database. is_modified ( ) {
76- if let Ok ( ( ) ) = reowned_database. save ( & key, & salt) {
77- println ! ( "Modifications have been persisted" ) ;
78- 0
79- } else {
80- eprintln ! ( "An error occurred during database overwriting" ) ;
81- -1
76+ match reowned_database. save ( & key, & salt) {
77+ Ok ( ( ) ) => {
78+ println ! ( "Modifications have been persisted" ) ;
79+ 0
80+ }
81+ _ => {
82+ eprintln ! ( "An error occurred during database overwriting" ) ;
83+ -1
84+ }
8285 }
8386 } else {
8487 0
You can’t perform that action at this time.
0 commit comments