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
.as_ref() and fmt
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Sep 7, 2022
commit 5bf05f87c62c506004bb0f900f2ad7e50a4ac897
7 changes: 6 additions & 1 deletion utils/frame/benchmarking-cli/src/overhead/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ impl TemplateData {
stats: &Stats,
) -> Result<Self> {
let weight = params.weight.calc_weight(stats)?;
let header = params.header.map(|p| std::fs::read_to_string(p)).transpose()?.unwrap_or_default();
let header = params
.header
.as_ref()
.map(|p| std::fs::read_to_string(p))
.transpose()?
.unwrap_or_default();

Ok(TemplateData {
short_name: t.short_name().into(),
Expand Down
7 changes: 6 additions & 1 deletion utils/frame/benchmarking-cli/src/storage/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ 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 = params.header.map(|p| std::fs::read_to_string(p)).transpose()?.unwrap_or_default();
let header = params
.header
.as_ref()
.map(|p| std::fs::read_to_string(p))
.transpose()?
.unwrap_or_default();

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