use std::borrow::Cow;
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct DbSchemaCred<'db_cred> {
pub schema_name: Option<Cow<'db_cred, str>>,
pub username: Cow<'db_cred, str>,
pub password: Cow<'db_cred, str>,
}
impl<'db_cred> DbSchemaCred<'db_cred> {
pub fn into_static(self) -> DbSchemaCred<'static> {
let DbSchemaCred::<'db_cred> {
schema_name,
username,
password,
} = self;
let schema_name = schema_name.map(Cow::into_owned).map(Cow::Owned);
let username = Cow::Owned(username.into_owned());
let password = Cow::Owned(password.into_owned());
DbSchemaCred {
schema_name,
username,
password,
}
}
}