Skip to content

Commit

Permalink
[chore]: format
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
  • Loading branch information
0x009922 committed Apr 26, 2024
1 parent fd24f5e commit 1513d92
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cli/src/lib.rs
Expand Up @@ -648,11 +648,11 @@ pub fn read_config_and_genesis(
let raw_block = RawGenesisBlock::from_path(file.resolve_relative_path())
.into_report()
// https://github.com/hashintel/hash/issues/4295
.map_err(|report|
.map_err(|report| {
report
.attach_printable(file.clone().into_attachment().display_path())
.change_context(ConfigError::ReadGenesis)
)?;
})?;

Some(GenesisNetwork::new(
raw_block,
Expand Down
5 changes: 4 additions & 1 deletion cli/src/samples.rs
Expand Up @@ -73,7 +73,10 @@ pub fn get_config_toml(
.write(["torii", "address"], DEFAULT_TORII_ADDR)
.write(["chain_wide", "max_transactions_in_block"], 2)
.write(["genesis", "public_key"], genesis_public_key)
.write(["genesis", "private_key"], ExposedPrivateKey(genesis_private_key))
.write(
["genesis", "private_key"],
ExposedPrivateKey(genesis_private_key),
)
.write(["genesis", "file"], "NEVER READ ME; YOU FOUND A BUG!")
// There is no need in persistence in tests.
// If required to should be set explicitly not to overlap with other existing tests
Expand Down
12 changes: 6 additions & 6 deletions config/base/derive/src/lib.rs
Expand Up @@ -18,16 +18,16 @@ use crate::ast::Input;
///
/// #[derive(ReadConfig)]
/// struct Config {
/// #[config(default, env = "FOO")]
/// foo: bool,
/// #[config(nested)]
/// nested: Nested
/// #[config(default, env = "FOO")]
/// foo: bool,
/// #[config(nested)]
/// nested: Nested,
/// }
///
/// #[derive(ReadConfig)]
/// struct Nested {
/// #[config(default = "42")]
/// foo: u64
/// #[config(default = "42")]
/// foo: u64,
/// }
/// ```
///
Expand Down
17 changes: 10 additions & 7 deletions config/base/src/toml.rs
Expand Up @@ -186,22 +186,25 @@ fn find_unknown_parameters(table: &toml::Table, known: &ParamTree) -> BTreeSet<P
/// A utility, primarily for testing, to conveniently write content into a [`Table`].
///
/// ```
/// use toml::Table;
/// use iroha_config_base::toml::Writer;
/// use toml::Table;
///
/// let mut table = Table::new();
/// Writer::new(&mut table)
/// .write("foo", "some string")
/// .write("bar", "some other string")
/// .write(["baz", "foo", "bar"], 42);
///
/// assert_eq!(table, toml::toml! {
/// foo = "some string"
/// bar = "some other string"
/// assert_eq!(
/// table,
/// toml::toml! {
/// foo = "some string"
/// bar = "some other string"
///
/// [baz.foo]
/// bar = 42
/// });
/// [baz.foo]
/// bar = 42
/// }
/// );
/// ```
#[derive(Debug)]
pub struct Writer<'a> {
Expand Down

0 comments on commit 1513d92

Please sign in to comment.