Skip to content

Commit 3d78a33

Browse files
committed
Derive clone for mpesa struct
1 parent 7f87f07 commit 3d78a33

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static CARGO_PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION");
2020
pub type MpesaResult<T> = Result<T, MpesaError>;
2121

2222
/// Mpesa client that will facilitate communication with the Safaricom API
23-
#[derive(Debug)]
23+
#[derive(Clone, Debug)]
2424
pub struct Mpesa<Env: ApiEnvironment> {
2525
client_key: String,
2626
client_secret: String,

src/environment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use crate::MpesaError;
1414
use std::{convert::TryFrom, str::FromStr};
1515

16-
#[derive(Debug)]
16+
#[derive(Debug, Clone)]
1717
/// Enum to map to desired environment so as to access certificate
1818
/// and the base url
1919
/// Required to construct a new `Mpesa` struct

tests/mpesa-rust/helpers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use mpesa::ApiEnvironment;
22
use wiremock::MockServer;
33

4+
#[derive(Debug, Clone)]
45
pub struct TestEnvironment {
56
pub server_url: String,
67
}

0 commit comments

Comments
 (0)