add cli for --accounts-hash-num-passes (#20827)
This commit is contained in:
committed by
GitHub
parent
e03dc9e8e3
commit
43ea579f63
@ -237,16 +237,16 @@ where
|
||||
is_parsable_generic::<Slot, _>(slot)
|
||||
}
|
||||
|
||||
pub fn is_bin<T>(bins: T) -> Result<(), String>
|
||||
pub fn is_pow2<T>(bins: T) -> Result<(), String>
|
||||
where
|
||||
T: AsRef<str> + Display,
|
||||
{
|
||||
bins.as_ref()
|
||||
.parse::<usize>()
|
||||
.map_err(|e| format!("Unable to parse bins, provided: {}, err: {}", bins, e))
|
||||
.map_err(|e| format!("Unable to parse, provided: {}, err: {}", bins, e))
|
||||
.and_then(|v| {
|
||||
if !v.is_power_of_two() {
|
||||
Err(format!("Bins must be a power of 2: {}", v))
|
||||
Err(format!("Must be a power of 2: {}", v))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user