Skip to content

Commit 8ba44ec

Browse files
committed
Add Send + Sync to IdenStatic when thread-safe is enabled
This allows SeaORM to reuse this type
1 parent 1542d0e commit 8ba44ec

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/types/iden/core.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ impl Iden for &'static str {
5151
}
5252
}
5353

54+
#[cfg(feature = "thread-safe")]
55+
/// Identifier statically known at compile-time.
56+
pub trait IdenStatic: Iden + Copy + Send + Sync + 'static {
57+
fn as_str(&self) -> &'static str;
58+
}
59+
60+
#[cfg(not(feature = "thread-safe"))]
5461
/// Identifier statically known at compile-time.
5562
pub trait IdenStatic: Iden + Copy + 'static {
5663
fn as_str(&self) -> &'static str;

0 commit comments

Comments
 (0)