Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
71a75cc2
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
71a75cc2
编写于
7月 20, 2014
作者:
B
Brian Anderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Just land already
上级
27e70c5d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
44 deletion
+44
-44
src/libcollections/dlist.rs
src/libcollections/dlist.rs
+23
-23
src/libcollections/lib.rs
src/libcollections/lib.rs
+18
-18
src/libcollections/string.rs
src/libcollections/string.rs
+1
-1
src/libcollections/vec.rs
src/libcollections/vec.rs
+1
-1
src/libstd/collections/hashmap.rs
src/libstd/collections/hashmap.rs
+1
-1
未找到文件。
src/libcollections/dlist.rs
浏览文件 @
71a75cc2
...
...
@@ -279,12 +279,12 @@ pub fn new() -> DList<T> {
/// # Example
///
/// ```rust
/// use std::collections::
{DList, Deque}
;
/// use std::collections::
DList
;
///
/// let mut dl = DList::new();
/// dl.push
_back
(1i);
/// dl.push
_back
(2);
/// dl.push
_back
(3);
/// dl.push(1i);
/// dl.push(2);
/// dl.push(3);
///
/// dl.rotate_forward();
///
...
...
@@ -306,12 +306,12 @@ pub fn rotate_forward(&mut self) {
/// # Example
///
/// ```rust
/// use std::collections::
{DList, Deque}
;
/// use std::collections::
DList
;
///
/// let mut dl = DList::new();
/// dl.push
_back
(1i);
/// dl.push
_back
(2);
/// dl.push
_back
(3);
/// dl.push(1i);
/// dl.push(2);
/// dl.push(3);
///
/// dl.rotate_backward();
///
...
...
@@ -333,14 +333,14 @@ pub fn rotate_backward(&mut self) {
/// # Example
///
/// ```rust
/// use std::collections::
{DList, Deque}
;
/// use std::collections::
DList
;
///
/// let mut a = DList::new();
/// let mut b = DList::new();
/// a.push
_back
(1i);
/// a.push
_back
(2);
/// b.push
_back
(3i);
/// b.push
_back
(4);
/// a.push(1i);
/// a.push(2);
/// b.push(3i);
/// b.push(4);
///
/// a.append(b);
///
...
...
@@ -374,14 +374,14 @@ pub fn append(&mut self, mut other: DList<T>) {
/// # Example
///
/// ```rust
/// use std::collections::
{DList, Deque}
;
/// use std::collections::
DList
;
///
/// let mut a = DList::new();
/// let mut b = DList::new();
/// a.push
_back
(1i);
/// a.push
_back
(2);
/// b.push
_back
(3i);
/// b.push
_back
(4);
/// a.push(1i);
/// a.push(2);
/// b.push(3i);
/// b.push(4);
///
/// a.prepend(b);
///
...
...
@@ -403,13 +403,13 @@ pub fn prepend(&mut self, mut other: DList<T>) {
/// # Example
///
/// ```rust
/// use std::collections::
{DList, Deque}
;
/// use std::collections::
DList
;
///
/// let mut a: DList<int> = DList::new();
/// a.push
_back
(2i);
/// a.push
_back
(4);
/// a.push
_back
(7);
/// a.push
_back
(8);
/// a.push(2i);
/// a.push(4);
/// a.push(7);
/// a.push(8);
///
/// // insert 11 before the first odd number in the list
/// a.insert_when(11, |&e, _| e % 2 == 1);
...
...
src/libcollections/lib.rs
浏览文件 @
71a75cc2
...
...
@@ -360,9 +360,9 @@ pub trait MutableSeq<T>: Mutable {
/// use std::collections::{RingBuf, Deque};
///
/// let mut queue = RingBuf::new();
/// queue.push
_back
(1i);
/// queue.push
_back
(2i);
/// queue.push
_back
(3i);
/// queue.push(1i);
/// queue.push(2i);
/// queue.push(3i);
///
/// // Will print 1, 2, 3
/// while !queue.is_empty() {
...
...
@@ -398,13 +398,13 @@ pub trait MutableSeq<T>: Mutable {
/// // Init deque with 1, 2, 3, 4
/// deque.push_front(2i);
/// deque.push_front(1i);
/// deque.push
_back
(3i);
/// deque.push
_back
(4i);
/// deque.push(3i);
/// deque.push(4i);
///
/// // Will print (1, 4) and (2, 3)
/// while !deque.is_empty() {
/// let f = deque.pop_front().unwrap();
/// let b = deque.pop
_back
().unwrap();
/// let b = deque.pop().unwrap();
/// println!("{}", (f, b));
/// }
/// ```
...
...
@@ -420,8 +420,8 @@ pub trait Deque<T> : MutableSeq<T> {
/// let mut d = RingBuf::new();
/// assert_eq!(d.front(), None);
///
/// d.push
_back
(1i);
/// d.push
_back
(2i);
/// d.push(1i);
/// d.push(2i);
/// assert_eq!(d.front(), Some(&1i));
/// ```
fn
front
<
'a
>
(
&
'a
self
)
->
Option
<&
'a
T
>
;
...
...
@@ -437,8 +437,8 @@ pub trait Deque<T> : MutableSeq<T> {
/// let mut d = RingBuf::new();
/// assert_eq!(d.front_mut(), None);
///
/// d.push
_back
(1i);
/// d.push
_back
(2i);
/// d.push(1i);
/// d.push(2i);
/// match d.front_mut() {
/// Some(x) => *x = 9i,
/// None => (),
...
...
@@ -458,8 +458,8 @@ pub trait Deque<T> : MutableSeq<T> {
/// let mut d = DList::new();
/// assert_eq!(d.back(), None);
///
/// d.push
_back
(1i);
/// d.push
_back
(2i);
/// d.push(1i);
/// d.push(2i);
/// assert_eq!(d.back(), Some(&2i));
/// ```
fn
back
<
'a
>
(
&
'a
self
)
->
Option
<&
'a
T
>
;
...
...
@@ -475,8 +475,8 @@ pub trait Deque<T> : MutableSeq<T> {
/// let mut d = DList::new();
/// assert_eq!(d.back(), None);
///
/// d.push
_back
(1i);
/// d.push
_back
(2i);
/// d.push(1i);
/// d.push(2i);
/// match d.back_mut() {
/// Some(x) => *x = 9i,
/// None => (),
...
...
@@ -503,7 +503,7 @@ pub trait Deque<T> : MutableSeq<T> {
///
/// # Example
///
/// ```
/// ```
ignore
/// use std::collections::{DList, Deque};
///
/// let mut d = DList::new();
...
...
@@ -518,7 +518,7 @@ fn push_back(&mut self, elt: T) { self.push(elt) }
///
/// # Example
///
/// ```
/// ```
ignore
/// use std::collections::{RingBuf, Deque};
///
/// let mut d = RingBuf::new();
...
...
@@ -540,8 +540,8 @@ fn pop_back(&mut self) -> Option<T> { self.pop() }
/// use std::collections::{RingBuf, Deque};
///
/// let mut d = RingBuf::new();
/// d.push
_back
(1i);
/// d.push
_back
(2i);
/// d.push(1i);
/// d.push(2i);
///
/// assert_eq!(d.pop_front(), Some(1i));
/// assert_eq!(d.pop_front(), Some(2i));
...
...
src/libcollections/string.rs
浏览文件 @
71a75cc2
...
...
@@ -575,7 +575,7 @@ mod tests {
use
std
::
prelude
::
*
;
use
test
::
Bencher
;
use
Mutable
;
use
{
Mutable
,
MutableSeq
}
;
use
str
;
use
str
::{
Str
,
StrSlice
,
Owned
,
Slice
};
use
super
::
String
;
...
...
src/libcollections/vec.rs
浏览文件 @
71a75cc2
...
...
@@ -981,7 +981,7 @@ pub fn swap_remove(&mut self, index: uint) -> Option<T> {
///
/// # Example
///
/// ```
/// ```
ignore
/// let mut vec = vec![1i, 2, 3];
/// vec.unshift(4);
/// assert_eq!(vec, vec![4, 1, 2, 3]);
...
...
src/libstd/collections/hashmap.rs
浏览文件 @
71a75cc2
...
...
@@ -1291,7 +1291,7 @@ pub fn insert_or_update_with<'a>(
/// // new value based on the first letter of the key.
/// |key, already, new| {
/// if key.as_slice().starts_with("z") {
/// already.
unshift(
new);
/// already.
insert(0,
new);
/// } else {
/// already.push(new);
/// }
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录