Cli: Update OutputFormat method to return a String to restore consistency (#9904)

* Update OutputFormat method to return a String to restore consistency

* Remove process_show_account special case
This commit is contained in:
Tyera Eulberg
2020-05-06 20:27:15 -06:00
committed by GitHub
parent d5c889d6b0
commit 65a52a4145
7 changed files with 23 additions and 39 deletions

View File

@@ -1316,8 +1316,7 @@ pub fn process_show_stake_account(
match stake_account.state() {
Ok(stake_state) => {
let state = build_stake_state(stake_account.lamports, &stake_state, use_lamports_unit);
config.output_format.formatted_print(&state);
Ok("".to_string())
Ok(config.output_format.formatted_string(&state))
}
Err(err) => Err(CliError::RpcRequestError(format!(
"Account data could not be deserialized to stake state: {}",
@@ -1345,8 +1344,7 @@ pub fn process_show_stake_history(
entries,
use_lamports_unit,
};
config.output_format.formatted_print(&stake_history_output);
Ok("".to_string())
Ok(config.output_format.formatted_string(&stake_history_output))
}
#[allow(clippy::too_many_arguments)]