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 11use std:: fmt;
22use std:: str:: FromStr ;
3+ use std:: io:: { self , Read , Write } ;
34
45use anyhow:: { anyhow, Error , Result } ;
56use multibase:: Base ;
@@ -119,13 +120,13 @@ impl From<StrBase> for Base {
119120fn encode ( base : StrBase , input : & [ u8 ] ) -> Result < ( ) > {
120121 log:: debug!( "Encode {:?} with {}" , input, base) ;
121122 let result = multibase:: encode ( base. into ( ) , input) ;
122- println ! ( "Result: {}" , result) ;
123+ print ! ( "{}" , result) ;
123124 Ok ( ( ) )
124125}
125126
126127fn decode ( input : & str ) -> Result < ( ) > {
127128 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) ? ;
130131 Ok ( ( ) )
131132}
You can’t perform that action at this time.
0 commit comments