From 39ffb59673807ad4fed708adf30b9e5e9de50533 Mon Sep 17 00:00:00 2001 From: Cadence Marseille Date: Sat, 16 May 2015 16:29:28 -0400 Subject: [PATCH] Vec::from_elem() -> vec! macro See rust-lang/rfcs#832 --- src/pcre/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pcre/mod.rs b/src/pcre/mod.rs index 69a6907..7006fab 100644 --- a/src/pcre/mod.rs +++ b/src/pcre/mod.rs @@ -488,7 +488,7 @@ impl Pcre { #[inline] pub fn exec_from_with_options<'a>(&self, subject: &'a str, startoffset: usize, options: &EnumSet) -> Option> { let ovecsize = (self.capture_count_ + 1) * 3; - let mut ovector = Vec::from_elem(ovecsize as usize, 0 as c_int); + let mut ovector = vec![0 as c_int; ovecsize as usize]; unsafe { subject.with_c_str_unchecked(|subject_c_str| -> Option> { @@ -557,7 +557,8 @@ impl Pcre { subject_cstring: subject.to_c_str_unchecked(), // the subject string can contain NUL bytes offset: 0, options: options.clone(), - ovector: Vec::from_elem(ovecsize as usize, 0 as c_int) + // /~https://github.com/rust-lang/rfcs/pull/832 + ovector: vec![0 as c_int; ovecsize as usize] } } }