auto merge of #15214 : tbu-/rust/pr_doc_vecinsert, r=huonw

This commit is contained in:
bors 2014-06-28 14:31:37 +00:00
commit b47f2226a2
1 changed files with 4 additions and 1 deletions

View File

@ -956,7 +956,8 @@ impl<T> Vec<T> {
///
/// # Failure
///
/// Fails if `index` is out of bounds of the vector.
/// Fails if `index` is not between `0` and the vector's length (both
/// bounds inclusive).
///
/// # Example
///
@ -964,6 +965,8 @@ impl<T> Vec<T> {
/// let mut vec = vec!(1i, 2, 3);
/// vec.insert(1, 4);
/// assert_eq!(vec, vec!(1, 4, 2, 3));
/// vec.insert(4, 5);
/// assert_eq!(vec, vec!(1, 4, 2, 3, 5));
/// ```
pub fn insert(&mut self, index: uint, element: T) {
let len = self.len();