Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/check-clippy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o errexit
source ./.evergreen/env.sh

# Pin clippy to the latest version. This should be updated when new versions of Rust are released.
CLIPPY_VERSION=1.88.0
CLIPPY_VERSION=1.90.0

rustup install $CLIPPY_VERSION

Expand Down
8 changes: 4 additions & 4 deletions src/action/aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl Database {
/// called, the returned cursor will be generic over the `T` specified.
#[deeplink]
#[options_doc(aggregate)]
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate {
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate<'_> {
Aggregate::new(
AggregateTargetRef::Database(self),
pipeline.into_iter().collect(),
Expand All @@ -61,7 +61,7 @@ where
/// called, the returned cursor will be generic over the `T` specified.
#[deeplink]
#[options_doc(aggregate)]
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate {
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate<'_> {
Aggregate::new(
AggregateTargetRef::Collection(CollRef::new(self)),
pipeline.into_iter().collect(),
Expand All @@ -82,7 +82,7 @@ impl crate::sync::Database {
/// returned cursor will be generic over the `T` specified.
#[deeplink]
#[options_doc(aggregate, "run")]
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate {
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate<'_> {
self.async_database.aggregate(pipeline)
}
}
Expand All @@ -103,7 +103,7 @@ where
/// returned cursor will be generic over the `T` specified.
#[deeplink]
#[options_doc(aggregate, "run")]
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate {
pub fn aggregate(&self, pipeline: impl IntoIterator<Item = Document>) -> Aggregate<'_> {
self.async_collection.aggregate(pipeline)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/action/bulk_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl Client {
pub fn bulk_write(
&self,
models: impl IntoIterator<Item = impl Into<WriteModel>>,
) -> BulkWrite<SummaryBulkWriteResult> {
) -> BulkWrite<'_, SummaryBulkWriteResult> {
let mut models_vec = Vec::new();
for model in models.into_iter() {
models_vec.push(model.into());
Expand Down Expand Up @@ -58,7 +58,7 @@ impl crate::sync::Client {
pub fn bulk_write(
&self,
models: impl IntoIterator<Item = impl Into<WriteModel>>,
) -> BulkWrite<SummaryBulkWriteResult> {
) -> BulkWrite<'_, SummaryBulkWriteResult> {
self.async_client.bulk_write(models)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/action/count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ where
/// `await` will return d[`Result<u64>`].
#[deeplink]
#[options_doc(estimated_doc_count)]
pub fn estimated_document_count(&self) -> EstimatedDocumentCount {
pub fn estimated_document_count(&self) -> EstimatedDocumentCount<'_> {
EstimatedDocumentCount {
cr: CollRef::new(self),
options: None,
Expand All @@ -49,7 +49,7 @@ where
/// `await` will return d[`Result<u64>`].
#[deeplink]
#[options_doc(count_docs)]
pub fn count_documents(&self, filter: Document) -> CountDocuments {
pub fn count_documents(&self, filter: Document) -> CountDocuments<'_> {
CountDocuments {
cr: CollRef::new(self),
filter,
Expand Down Expand Up @@ -79,7 +79,7 @@ where
/// [`run`](EstimatedDocumentCount::run) will return d[`Result<u64>`].
#[deeplink]
#[options_doc(estimated_doc_count, "run")]
pub fn estimated_document_count(&self) -> EstimatedDocumentCount {
pub fn estimated_document_count(&self) -> EstimatedDocumentCount<'_> {
self.async_collection.estimated_document_count()
}

Expand All @@ -90,7 +90,7 @@ where
/// [`run`](CountDocuments::run) will return d[`Result<u64>`].
#[deeplink]
#[options_doc(count_docs, "run")]
pub fn count_documents(&self, filter: Document) -> CountDocuments {
pub fn count_documents(&self, filter: Document) -> CountDocuments<'_> {
self.async_collection.count_documents(filter)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/action/create_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Database {
/// `await` will return d[`Result<()>`].
#[deeplink]
#[options_doc(create_coll)]
pub fn create_collection(&self, name: impl Into<String>) -> CreateCollection {
pub fn create_collection(&self, name: impl Into<String>) -> CreateCollection<'_> {
CreateCollection {
db: self,
name: name.into(),
Expand All @@ -48,7 +48,7 @@ impl crate::sync::Database {
/// [`run`](CreateCollection::run) will return d[`Result<()>`].
#[deeplink]
#[options_doc(create_coll, "run")]
pub fn create_collection(&self, name: impl Into<String>) -> CreateCollection {
pub fn create_collection(&self, name: impl Into<String>) -> CreateCollection<'_> {
self.async_database.create_collection(name)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/action/create_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ where
/// `await` will return d[`Result<CreateIndexResult>`].
#[deeplink]
#[options_doc(create_index)]
pub fn create_index(&self, index: IndexModel) -> CreateIndex {
pub fn create_index(&self, index: IndexModel) -> CreateIndex<'_> {
CreateIndex {
coll: CollRef::new(self),
indexes: vec![index],
Expand Down Expand Up @@ -72,7 +72,7 @@ where
/// [`run`](CreateIndex::run) will return d[`Result<CreateIndexResult>`].
#[deeplink]
#[options_doc(create_index, "run")]
pub fn create_index(&self, index: IndexModel) -> CreateIndex {
pub fn create_index(&self, index: IndexModel) -> CreateIndex<'_> {
self.async_collection.create_index(index)
}

Expand Down
2 changes: 1 addition & 1 deletion src/action/csfle/create_data_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl ClientEncryption {
/// document as a UUID.
#[deeplink]
#[options_doc(create_data_keys)]
pub fn create_data_key(&self, master_key: impl Into<MasterKey>) -> CreateDataKey {
pub fn create_data_key(&self, master_key: impl Into<MasterKey>) -> CreateDataKey<'_> {
CreateDataKey {
client_enc: self,
master_key: master_key.into(),
Expand Down
2 changes: 1 addition & 1 deletion src/action/csfle/encrypt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl ClientEncryption {
value: impl Into<crate::bson::RawBson>,
key: impl Into<EncryptKey>,
algorithm: Algorithm,
) -> Encrypt {
) -> Encrypt<'_> {
Encrypt {
client_enc: self,
mode: Value {
Expand Down
8 changes: 4 additions & 4 deletions src/action/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ where
/// `await` will return d[`Result<DeleteResult>`].
#[deeplink]
#[options_doc(delete)]
pub fn delete_one(&self, query: Document) -> Delete {
pub fn delete_one(&self, query: Document) -> Delete<'_> {
Delete {
coll: CollRef::new(self),
query,
Expand All @@ -42,7 +42,7 @@ where
/// `await` will return d[`Result<DeleteResult>`].
#[deeplink]
#[options_doc(delete)]
pub fn delete_many(&self, query: Document) -> Delete {
pub fn delete_many(&self, query: Document) -> Delete<'_> {
Delete {
coll: CollRef::new(self),
query,
Expand All @@ -68,7 +68,7 @@ where
/// [`run`](Delete::run) will return d[`Result<DeleteResult>`].
#[deeplink]
#[options_doc(delete, "run")]
pub fn delete_one(&self, query: Document) -> Delete {
pub fn delete_one(&self, query: Document) -> Delete<'_> {
self.async_collection.delete_one(query)
}

Expand All @@ -77,7 +77,7 @@ where
/// [`run`](Delete::run) will return d[`Result<DeleteResult>`].
#[deeplink]
#[options_doc(delete, "run")]
pub fn delete_many(&self, query: Document) -> Delete {
pub fn delete_many(&self, query: Document) -> Delete<'_> {
self.async_collection.delete_many(query)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/action/distinct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ where
/// `await` will return d[`Result<Vec<Bson>>`].
#[deeplink]
#[options_doc(distinct)]
pub fn distinct(&self, field_name: impl AsRef<str>, filter: Document) -> Distinct {
pub fn distinct(&self, field_name: impl AsRef<str>, filter: Document) -> Distinct<'_> {
Distinct {
coll: CollRef::new(self),
field_name: field_name.as_ref().to_string(),
Expand All @@ -45,7 +45,7 @@ where
/// [`run`](Distinct::run) will return d[`Result<Vec<Bson>>`].
#[deeplink]
#[options_doc(distinct, "run")]
pub fn distinct(&self, field_name: impl AsRef<str>, filter: Document) -> Distinct {
pub fn distinct(&self, field_name: impl AsRef<str>, filter: Document) -> Distinct<'_> {
self.async_collection.distinct(field_name, filter)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/action/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl Database {
/// `await` will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_db)]
pub fn drop(&self) -> DropDatabase {
pub fn drop(&self) -> DropDatabase<'_> {
DropDatabase {
db: self,
options: None,
Expand All @@ -36,7 +36,7 @@ impl crate::sync::Database {
/// [`run`](DropDatabase::run) will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_db, "run")]
pub fn drop(&self) -> DropDatabase {
pub fn drop(&self) -> DropDatabase<'_> {
self.async_database.drop()
}
}
Expand Down Expand Up @@ -80,7 +80,7 @@ where
/// `await` will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_coll)]
pub fn drop(&self) -> DropCollection {
pub fn drop(&self) -> DropCollection<'_> {
DropCollection {
cr: CollRef::new(self),
options: None,
Expand All @@ -99,7 +99,7 @@ where
/// [`run`](DropCollection::run) will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_coll, "run")]
pub fn drop(&self) -> DropCollection {
pub fn drop(&self) -> DropCollection<'_> {
self.async_collection.drop()
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/action/drop_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
/// `await` will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_index)]
pub fn drop_index(&self, name: impl AsRef<str>) -> DropIndex {
pub fn drop_index(&self, name: impl AsRef<str>) -> DropIndex<'_> {
DropIndex {
coll: CollRef::new(self),
name: Some(name.as_ref().to_string()),
Expand All @@ -36,7 +36,7 @@ where
/// `await` will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_index)]
pub fn drop_indexes(&self) -> DropIndex {
pub fn drop_indexes(&self) -> DropIndex<'_> {
DropIndex {
coll: CollRef::new(self),
name: None,
Expand All @@ -56,7 +56,7 @@ where
/// [`run`](DropIndex::run) will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_index, "run")]
pub fn drop_index(&self, name: impl AsRef<str>) -> DropIndex {
pub fn drop_index(&self, name: impl AsRef<str>) -> DropIndex<'_> {
self.async_collection.drop_index(name)
}

Expand All @@ -65,7 +65,7 @@ where
/// [`run`](DropIndex::run) will return d[`Result<()>`].
#[deeplink]
#[options_doc(drop_index, "run")]
pub fn drop_indexes(&self) -> DropIndex {
pub fn drop_indexes(&self) -> DropIndex<'_> {
self.async_collection.drop_indexes()
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/action/gridfs/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl GridFsBucket {
/// bucket.
///
/// `await` will return [`Result<()>`].
pub fn delete(&self, id: Bson) -> Delete {
pub fn delete(&self, id: Bson) -> Delete<'_> {
Delete { bucket: self, id }
}

Expand All @@ -23,7 +23,7 @@ impl GridFsBucket {
/// bucket.
///
/// `await` will return [`Result<()>`].
pub fn delete_by_name(&self, filename: impl Into<String>) -> DeleteByName {
pub fn delete_by_name(&self, filename: impl Into<String>) -> DeleteByName<'_> {
DeleteByName {
bucket: self,
filename: filename.into(),
Expand All @@ -38,7 +38,7 @@ impl crate::sync::gridfs::GridFsBucket {
/// bucket.
///
/// [`run`](Delete::run) will return [`Result<()>`].
pub fn delete(&self, id: Bson) -> Delete {
pub fn delete(&self, id: Bson) -> Delete<'_> {
self.async_bucket.delete(id)
}

Expand All @@ -47,7 +47,7 @@ impl crate::sync::gridfs::GridFsBucket {
/// bucket.
///
/// [`run`](DeleteByName::run) will return [`Result<()>`].
pub fn delete_by_name(&self, filename: impl Into<String>) -> DeleteByName {
pub fn delete_by_name(&self, filename: impl Into<String>) -> DeleteByName<'_> {
self.async_bucket.delete_by_name(filename)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/action/gridfs/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl GridFsBucket {
///
/// `await` will return d[`Result<GridFsDownloadStream>`].
#[deeplink]
pub fn open_download_stream(&self, id: Bson) -> OpenDownloadStream {
pub fn open_download_stream(&self, id: Bson) -> OpenDownloadStream<'_> {
OpenDownloadStream { bucket: self, id }
}

Expand All @@ -35,7 +35,7 @@ impl GridFsBucket {
pub fn open_download_stream_by_name(
&self,
filename: impl Into<String>,
) -> OpenDownloadStreamByName {
) -> OpenDownloadStreamByName<'_> {
OpenDownloadStreamByName {
bucket: self,
filename: filename.into(),
Expand Down Expand Up @@ -101,7 +101,7 @@ impl crate::sync::gridfs::GridFsBucket {
///
/// [`run`](OpenDownloadStream::run) will return d[`Result<GridFsDownloadStream>`].
#[deeplink]
pub fn open_download_stream(&self, id: Bson) -> OpenDownloadStream {
pub fn open_download_stream(&self, id: Bson) -> OpenDownloadStream<'_> {
self.async_bucket.open_download_stream(id)
}

Expand All @@ -119,7 +119,7 @@ impl crate::sync::gridfs::GridFsBucket {
pub fn open_download_stream_by_name(
&self,
filename: impl Into<String>,
) -> OpenDownloadStreamByName {
) -> OpenDownloadStreamByName<'_> {
self.async_bucket.open_download_stream_by_name(filename)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/action/gridfs/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ impl GridFsBucket {
/// Removes all of the files and their associated chunks from this bucket.
///
/// `await` will return [`Result<()>`].
pub fn drop(&self) -> Drop {
pub fn drop(&self) -> Drop<'_> {
Drop { bucket: self }
}
}
Expand All @@ -14,7 +14,7 @@ impl crate::sync::gridfs::GridFsBucket {
/// Removes all of the files and their associated chunks from this bucket.
///
/// [`run`](Drop::run) will return [`Result<()>`].
pub fn drop(&self) -> Drop {
pub fn drop(&self) -> Drop<'_> {
self.async_bucket.drop()
}
}
Expand Down
Loading