Move occurs because `public_key` has type `String`, which does not implement the `Copy` trait

Please how do i fix this error?

#[derive(Debug, Clone)]
pub struct Paypal {
    pub public_key: String,
    pub secret_key: String,
    pub payment: payment::Payment
}

impl Paypal {
    pub fn new (public_key: String, secret_key: String) -> Self {
        Paypal {
            public_key,
            secret_key,
            payment: payment::Payment::new(public_key, secret_key),
        }
    }
}

Please study the relevant chapter in the Book.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.