Skip to content

Commit 5bb236b

Browse files
committed
gate behind db feature
1 parent 89a3858 commit 5bb236b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cot/src/auth.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,8 @@ impl PasswordHash {
587587
/// # Examples
588588
///
589589
/// ```
590-
/// use cot::auth::{Password, PasswordHash};
590+
/// use cot::auth::PasswordHash;
591+
/// use cot::form::types::Password;
591592
///
592593
/// let hash = PasswordHash::from_password(&Password::new("password"));
593594
/// assert!(!hash.as_str().is_empty());
@@ -607,7 +608,8 @@ impl PasswordHash {
607608
/// # Examples
608609
///
609610
/// ```
610-
/// use cot::auth::{Password, PasswordHash};
611+
/// use cot::auth::PasswordHash;
612+
/// use cot::form::types::Password;
611613
///
612614
/// let hash = PasswordHash::from_password(&Password::new("password"));
613615
/// assert!(!hash.into_string().is_empty());

cot/src/form/types.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
use std::fmt::Debug;
99
use std::str::FromStr;
1010

11+
#[cfg(feature = "db")]
1112
use cot::db::impl_mysql::MySqlValueRef;
13+
#[cfg(feature = "db")]
1214
use cot::db::impl_postgres::PostgresValueRef;
15+
#[cfg(feature = "db")]
1316
use cot::db::impl_sqlite::SqliteValueRef;
1417
use email_address::EmailAddress;
1518

@@ -270,6 +273,7 @@ impl TryFrom<String> for Email {
270273
/// Implements database value conversion for `Email`.
271274
///
272275
/// This allows `Email` to be stored in the database as a text value.
276+
#[cfg(feature = "db")]
273277
impl ToDbValue for Email {
274278
fn to_db_value(&self) -> DbValue {
275279
self.0.clone().to_string().into()

0 commit comments

Comments
 (0)