File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
use std:: fmt;
2
2
use std:: str:: FromStr ;
3
+ use std:: io:: { self , Read , Write } ;
3
4
4
5
use anyhow:: { anyhow, Error , Result } ;
5
6
use multibase:: Base ;
@@ -119,13 +120,13 @@ impl From<StrBase> for Base {
119
120
fn encode ( base : StrBase , input : & [ u8 ] ) -> Result < ( ) > {
120
121
log:: debug!( "Encode {:?} with {}" , input, base) ;
121
122
let result = multibase:: encode ( base. into ( ) , input) ;
122
- println ! ( "Result: {}" , result) ;
123
+ print ! ( "{}" , result) ;
123
124
Ok ( ( ) )
124
125
}
125
126
126
127
fn decode ( input : & str ) -> Result < ( ) > {
127
128
log:: debug!( "Decode {:?}" , input) ;
128
- let ( base , result) = multibase:: decode ( input) ?;
129
- println ! ( "Result: {}, {:?}" , StrBase ( base ) , result) ;
129
+ let ( _ , result) = multibase:: decode ( input) ?;
130
+ io :: stdout ( ) . write_all ( & result) ? ;
130
131
Ok ( ( ) )
131
132
}
You can’t perform that action at this time.
0 commit comments