File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -246,10 +246,10 @@ impl TryFrom<Binary> for Vector {
246246 }
247247}
248248
249- // Convenience impl to allow passing a Vector directly into the doc! macro. From<Vector> is already
249+ // Convenience impl to allow passing a Vector directly into the doc! macro. From<& Vector> is already
250250// implemented by a blanket impl in src/bson.rs.
251- impl From < & Vector > for Bson {
252- fn from ( vector : & Vector ) -> Self {
251+ impl From < Vector > for Bson {
252+ fn from ( vector : Vector ) -> Self {
253253 Self :: Binary ( Binary :: from ( vector) )
254254 }
255255}
Original file line number Diff line number Diff line change @@ -170,6 +170,8 @@ fn run_test_file(test_file: TestFile) {
170170 // From<Vector> for Bson
171171 let document = doc ! { "vector" : & test_vector } ;
172172 assert_eq ! ( document, test_document) ;
173+ let document = doc ! { "vector" : test_vector. clone( ) } ;
174+ assert_eq ! ( document, test_document) ;
173175
174176 // From<Vector> for RawBson
175177 let raw_document = rawdoc ! { "vector" : & test_vector } ;
You can’t perform that action at this time.
0 commit comments