Skip to content

Commit 5ed5a70

Browse files
committed
Fix changes with pipeline
1 parent 0f81bc9 commit 5ed5a70

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

sdk/cosmos/src/operations/create_database.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::prelude::*;
33
use crate::resources::Database;
44
use crate::ResourceQuota;
55
use azure_core::headers::{etag_from_headers, session_token_from_headers};
6-
use azure_core::{collect_pinned_stream, Context, PipelineContext, Response as HttpResponse};
6+
use azure_core::{collect_pinned_stream, Context, Response as HttpResponse};
77
use chrono::{DateTime, Utc};
88

99
#[derive(Debug, Clone)]
@@ -34,15 +34,12 @@ impl CreateDatabaseBuilder {
3434
self
3535
}
3636

37-
pub fn into_future(self) -> CreateDatabase {
38-
Box::pin(async {
37+
pub fn into_future(mut self) -> CreateDatabase {
38+
Box::pin(async move {
3939
let mut request = self
4040
.client
4141
.prepare_request_pipeline("dbs", http::Method::POST);
4242

43-
let mut pipeline_context =
44-
PipelineContext::new(self.context, ResourceType::Databases.into());
45-
4643
let body = CreateDatabaseBody {
4744
id: self.database_name.as_str(),
4845
};
@@ -52,7 +49,7 @@ impl CreateDatabaseBuilder {
5249
let response = self
5350
.client
5451
.pipeline()
55-
.send(&mut pipeline_context, &mut request)
52+
.send(&mut self.context, &mut request)
5653
.await?;
5754

5855
CreateDatabaseResponse::try_from(response).await

0 commit comments

Comments
 (0)