Skip to content

Commit f7503a1

Browse files
authored
feat: add mut arg setters for node bindings (#2308)
1 parent 795277a commit f7503a1

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Diff for: crates/node-bindings/src/nodes/anvil.rs

+16
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,22 @@ impl Anvil {
284284
self
285285
}
286286

287+
/// Adds an argument to pass to the `anvil`.
288+
pub fn push_arg<T: Into<OsString>>(&mut self, arg: T) {
289+
self.args.push(arg.into());
290+
}
291+
292+
/// Adds multiple arguments to pass to the `anvil`.
293+
pub fn extend_args<I, S>(&mut self, args: I)
294+
where
295+
I: IntoIterator<Item = S>,
296+
S: Into<OsString>,
297+
{
298+
for arg in args {
299+
self.push_arg(arg);
300+
}
301+
}
302+
287303
/// Adds an argument to pass to the `anvil`.
288304
pub fn arg<T: Into<OsString>>(mut self, arg: T) -> Self {
289305
self.args.push(arg.into());

Diff for: crates/node-bindings/src/nodes/geth.rs

+16
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,22 @@ impl Geth {
378378
self
379379
}
380380

381+
/// Adds an argument to pass to the `geth`.
382+
pub fn push_arg<T: Into<OsString>>(&mut self, arg: T) {
383+
self.args.push(arg.into());
384+
}
385+
386+
/// Adds multiple arguments to pass to the `geth`.
387+
pub fn extend_args<I, S>(&mut self, args: I)
388+
where
389+
I: IntoIterator<Item = S>,
390+
S: Into<OsString>,
391+
{
392+
for arg in args {
393+
self.push_arg(arg);
394+
}
395+
}
396+
381397
/// Adds an argument to pass to `geth`.
382398
///
383399
/// Pass any arg that is not supported by the builder.

0 commit comments

Comments
 (0)