From 14e42b48bdcd61588252ec1563a50d56b6aea70b Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 28 Jul 2019 15:29:47 +0300 Subject: [PATCH] dc_get_locations: use from(Vec) instead of add_location --- src/dc_location.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dc_location.rs b/src/dc_location.rs index bdef8671e..132d0f505 100644 --- a/src/dc_location.rs +++ b/src/dc_location.rs @@ -250,12 +250,12 @@ pub fn dc_get_locations( Ok(loc) }, |locations| { - let mut ret = dc_array_t::new_locations(500); + let mut ret = Vec::new(); for location in locations { - ret.add_location(location?); + ret.push(location?); } - Ok(ret.into_raw()) + Ok(dc_array_t::from(ret).into_raw()) }, ) .unwrap_or_else(|_| std::ptr::null_mut())