diff --git a/src/client.rs b/src/client.rs index 8532762..5470983 100644 --- a/src/client.rs +++ b/src/client.rs @@ -204,7 +204,7 @@ pub struct Client<'a> { } impl<'a> Client<'a> { - pub fn get_collection>>(&'a self, db: S, collection: S) -> Collection<'a> { + pub fn get_collection>, CT: Into>>(&'a self, db: DBT, collection: CT) -> Collection<'a> { assert!(!self.inner.is_null()); let coll = unsafe { let db_cstring = CString::new(db).unwrap(); diff --git a/tests/collection.rs b/tests/collection.rs index 0414f35..51ca2f0 100644 --- a/tests/collection.rs +++ b/tests/collection.rs @@ -23,6 +23,7 @@ fn test_mutation_and_finding() { let uri = Uri::new("mongodb://localhost:27017/").unwrap(); let pool = ClientPool::new(uri, None); let client = pool.pop(); + let _ = client.get_collection("rust_driver_test".to_string(), "items"); let mut collection = client.get_collection("rust_driver_test", "items"); collection.drop().unwrap_or(());