Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
ggwpez and bkchr authored Sep 7, 2022
commit 046ec25a22c110ef26e6d78409c9d7bddbc470a7
6 changes: 1 addition & 5 deletions utils/frame/benchmarking-cli/src/overhead/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ impl TemplateData {
stats: &Stats,
) -> Result<Self> {
let weight = params.weight.calc_weight(stats)?;
let header = if let Some(ref path) = params.header {
std::fs::read_to_string(path)?
} else {
String::new()
};
let header = params.header.map(|p| std::fs::read_to_string(p)).transpose()?.unwrap_or_default();

Ok(TemplateData {
short_name: t.short_name().into(),
Expand Down
6 changes: 1 addition & 5 deletions utils/frame/benchmarking-cli/src/storage/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ pub(crate) struct TemplateData {
impl TemplateData {
/// Returns a new [`Self`] from the given configuration.
pub fn new(cfg: &Configuration, params: &StorageParams) -> Result<Self> {
let header = if let Some(ref path) = params.header {
std::fs::read_to_string(path)?
} else {
String::new()
};
let header = params.header.map(|p| std::fs::read_to_string(p)).transpose()?.unwrap_or_default();

Ok(TemplateData {
db_name: format!("{}", cfg.database),
Expand Down