From 9d4e4e9d29370dc4105c3821ed3664f37ab9e904 Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Fri, 27 Oct 2023 10:21:07 +0200 Subject: [PATCH] Add `async-trait` to `workspace` --- Cargo.lock | 1 + Cargo.toml | 1 + crates/nostr-sdk-db/Cargo.toml | 2 +- crates/nostr-sdk-db/src/lib.rs | 2 +- crates/nostr-sdk-rocksdb/Cargo.toml | 1 + crates/nostr-sdk-rocksdb/examples/rocksdb.rs | 2 +- crates/nostr-sdk-rocksdb/src/lib.rs | 6 +++--- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42689119b..e37c674a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1281,6 +1281,7 @@ dependencies = [ name = "nostr-sdk-rocksdb" version = "0.1.0" dependencies = [ + "async-trait", "nostr", "nostr-sdk-db", "nostr-sdk-fbs", diff --git a/Cargo.toml b/Cargo.toml index 868abbbe0..1b8a55e58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ license = "MIT" rust-version = "1.64.0" [workspace.dependencies] +async-trait = "0.1" nostr = { version = "0.24", path = "./crates/nostr", default-features = false } once_cell = "1.18" thiserror = "1.0" diff --git a/crates/nostr-sdk-db/Cargo.toml b/crates/nostr-sdk-db/Cargo.toml index cab02c3c4..671e9e89e 100644 --- a/crates/nostr-sdk-db/Cargo.toml +++ b/crates/nostr-sdk-db/Cargo.toml @@ -12,7 +12,7 @@ rust-version.workspace = true keywords = ["nostr", "sdk", "db"] [dependencies] -async-trait = "0.1" +async-trait = { workspace = true } nostr = { workspace = true, features = ["std"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["sync"] } diff --git a/crates/nostr-sdk-db/src/lib.rs b/crates/nostr-sdk-db/src/lib.rs index 1b55b018c..39fffedb4 100644 --- a/crates/nostr-sdk-db/src/lib.rs +++ b/crates/nostr-sdk-db/src/lib.rs @@ -9,7 +9,7 @@ use std::collections::HashSet; -use async_trait::async_trait; +pub use async_trait::async_trait; use nostr::{Event, EventId, Filter, Timestamp, Url}; mod error; diff --git a/crates/nostr-sdk-rocksdb/Cargo.toml b/crates/nostr-sdk-rocksdb/Cargo.toml index a9e867207..f2b07285e 100644 --- a/crates/nostr-sdk-rocksdb/Cargo.toml +++ b/crates/nostr-sdk-rocksdb/Cargo.toml @@ -12,6 +12,7 @@ rust-version.workspace = true keywords = ["nostr", "sdk", "db", "redb"] [dependencies] +async-trait = { workspace = true } nostr = { workspace = true, features = ["std"] } nostr-sdk-db = { version = "0.1", path = "../nostr-sdk-db" } nostr-sdk-fbs = { version = "0.1", path = "../nostr-sdk-fbs" } diff --git a/crates/nostr-sdk-rocksdb/examples/rocksdb.rs b/crates/nostr-sdk-rocksdb/examples/rocksdb.rs index b26c63df2..fdfd50aa6 100644 --- a/crates/nostr-sdk-rocksdb/examples/rocksdb.rs +++ b/crates/nostr-sdk-rocksdb/examples/rocksdb.rs @@ -1,7 +1,7 @@ // Copyright (c) 2022-2023 Yuki Kishimoto // Distributed under the MIT software license -use std::time::{Duration, Instant}; +// use std::time::{Duration, Instant}; use nostr::prelude::*; use nostr_sdk_db::NostrDatabase; diff --git a/crates/nostr-sdk-rocksdb/src/lib.rs b/crates/nostr-sdk-rocksdb/src/lib.rs index 51ee373fc..88224704c 100644 --- a/crates/nostr-sdk-rocksdb/src/lib.rs +++ b/crates/nostr-sdk-rocksdb/src/lib.rs @@ -5,9 +5,9 @@ use std::collections::HashSet; use std::path::Path; use std::sync::Arc; -use nostr::FiltersMatchEvent; -use nostr_sdk_db::nostr::{Event, EventId, Filter, Timestamp, Url}; -use nostr_sdk_db::{async_trait, Backend, DatabaseError, DatabaseOptions, NostrDatabase}; +use async_trait::async_trait; +use nostr::{Event, EventId, Filter, Timestamp, Url}; +use nostr_sdk_db::{Backend, DatabaseError, DatabaseOptions, NostrDatabase}; use nostr_sdk_fbs::{FlatBufferBuilder, FlatBufferUtils}; use rocksdb::{ BoundColumnFamily, ColumnFamilyDescriptor, DBCompactionStyle, DBCompressionType,