Skip to content

Commit f152940

Browse files
committed
Add nightly only into_future feature
1 parent 5296a91 commit f152940

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

sdk/data_cosmos/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ stop-token = { version = "0.7.0", features = ["tokio"] }
4343
[features]
4444
test_e2e = []
4545
mock_transport_framework = [ "azure_core/mock_transport_framework"]
46+
into_future = []

sdk/data_cosmos/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![allow(clippy::enum_variant_names)]
22
#![allow(clippy::new_without_default)]
33
#![allow(clippy::module_inception)]
4+
#![cfg_attr(feature = "into_future", feature(into_future))]
45

56
/*!
67
# The Cosmos DB crate.

sdk/data_cosmos/src/operations/create_database.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ impl CreateDatabaseBuilder {
6464
}
6565
}
6666

67-
/// A future of a create database response
67+
#[cfg(feature = "into_future")]
68+
impl std::future::IntoFuture for CreateDatabaseBuilder {
69+
type Future = CreateDatabase;
70+
type Output = <CreateDatabase as std::future::Future>::Output;
71+
fn into_future(self) -> Self::Future {
72+
Self::into_future(self)
73+
}
74+
}
75+
6876
type CreateDatabase =
6977
futures::future::BoxFuture<'static, azure_core::error::Result<CreateDatabaseResponse>>;
7078

0 commit comments

Comments
 (0)