Fix lint in `family-xo` feature
Fixes `clippy::new_without_default` and `clippy::identity_conversion`
lints in code behind the `family-xo` feature.
@@ -24,6 +24,12 @@ pub struct XoTransactionWorkload {
signer: Box<dyn Signer>,
}
+impl Default for XoTransactionWorkload {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl XoTransactionWorkload {
pub fn new() -> Self {
let rng = Hc128Rng::from_entropy();
@@ -74,6 +80,12 @@ pub struct XoBatchWorkload {
signer: Box<dyn Signer>,
}
+impl Default for XoBatchWorkload {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl XoBatchWorkload {
pub fn new() -> XoBatchWorkload {
let signer = HashSigner::default();
@@ -136,7 +148,7 @@ impl Payload {
pub fn bytes(&self) -> Vec<u8> {
match self.action {
- Action::CREATE => String::from(format!("create,{},", self.name)),
+ Action::CREATE => format!("create,{},", self.name),
}
.into_bytes()
}
