Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
9db1d356
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,发现更多精彩内容 >>
提交
9db1d356
编写于
7月 14, 2014
作者:
B
Brian Anderson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
collections: Deprecate shift/unshift
Use insert/remove instead.
上级
94e42c2d
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
10 addition
and
8 deletion
+10
-8
src/compiletest/runtest.rs
src/compiletest/runtest.rs
+1
-1
src/libcollections/vec.rs
src/libcollections/vec.rs
+2
-0
src/libregex/parse.rs
src/libregex/parse.rs
+1
-1
src/librustdoc/lib.rs
src/librustdoc/lib.rs
+1
-1
src/librustdoc/markdown.rs
src/librustdoc/markdown.rs
+1
-1
src/librustdoc/test.rs
src/librustdoc/test.rs
+1
-1
src/librustuv/access.rs
src/librustuv/access.rs
+1
-1
src/libterm/terminfo/parm.rs
src/libterm/terminfo/parm.rs
+2
-2
未找到文件。
src/compiletest/runtest.rs
浏览文件 @
9db1d356
...
...
@@ -1178,7 +1178,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) ->
// Add the arguments in the run_flags directive
args
.push_all_move
(
split_maybe_args
(
&
props
.run_flags
));
let
prog
=
args
.
shift
(
)
.unwrap
();
let
prog
=
args
.
remove
(
0
)
.unwrap
();
return
ProcArgs
{
prog
:
prog
,
args
:
args
,
...
...
src/libcollections/vec.rs
浏览文件 @
9db1d356
...
...
@@ -987,6 +987,7 @@ pub fn swap_remove(&mut self, index: uint) -> Option<T> {
/// assert_eq!(vec, vec![4, 1, 2, 3]);
/// ```
#[inline]
#[deprecated
=
"use insert(0, ...)"
]
pub
fn
unshift
(
&
mut
self
,
element
:
T
)
{
self
.insert
(
0
,
element
)
}
...
...
@@ -1007,6 +1008,7 @@ pub fn unshift(&mut self, element: T) {
/// assert_eq!(vec, vec![2, 3]);
/// ```
#[inline]
#[deprecated
=
"use remove(0)"
]
pub
fn
shift
(
&
mut
self
)
->
Option
<
T
>
{
self
.remove
(
0
)
}
...
...
src/libregex/parse.rs
浏览文件 @
9db1d356
...
...
@@ -998,7 +998,7 @@ fn concat_flatten(x: Ast, y: Ast) -> Ast {
match
(
x
,
y
)
{
(
Cat
(
mut
xs
),
Cat
(
ys
))
=>
{
xs
.push_all_move
(
ys
);
Cat
(
xs
)
}
(
Cat
(
mut
xs
),
ast
)
=>
{
xs
.push
(
ast
);
Cat
(
xs
)
}
(
ast
,
Cat
(
mut
xs
))
=>
{
xs
.
unshift
(
ast
);
Cat
(
xs
)
}
(
ast
,
Cat
(
mut
xs
))
=>
{
xs
.
insert
(
0
,
ast
);
Cat
(
xs
)
}
(
ast1
,
ast2
)
=>
Cat
(
vec!
(
ast1
,
ast2
)),
}
}
...
...
src/librustdoc/lib.rs
浏览文件 @
9db1d356
...
...
@@ -361,7 +361,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
}
if
default_passes
{
for
name
in
DEFAULT_PASSES
.iter
()
.rev
()
{
passes
.
unshift
(
name
.to_string
());
passes
.
insert
(
0
,
name
.to_string
());
}
}
...
...
src/librustdoc/markdown.rs
浏览文件 @
9db1d356
...
...
@@ -136,7 +136,7 @@ pub fn test(input: &str, libs: HashSet<Path>, externs: core::Externs,
let
mut
collector
=
Collector
::
new
(
input
.to_string
(),
libs
,
externs
,
true
);
find_testable_code
(
input_str
.as_slice
(),
&
mut
collector
);
test_args
.
unshift
(
"rustdoctest"
.to_string
());
test_args
.
insert
(
0
,
"rustdoctest"
.to_string
());
testing
::
test_main
(
test_args
.as_slice
(),
collector
.tests
);
0
}
src/librustdoc/test.rs
浏览文件 @
9db1d356
...
...
@@ -97,7 +97,7 @@ pub fn run(input: &str,
false
);
collector
.fold_crate
(
krate
);
test_args
.
unshift
(
"rustdoctest"
.to_string
());
test_args
.
insert
(
0
,
"rustdoctest"
.to_string
());
testing
::
test_main
(
test_args
.as_slice
(),
collector
.tests
.move_iter
()
.collect
());
...
...
src/librustuv/access.rs
浏览文件 @
9db1d356
...
...
@@ -114,7 +114,7 @@ fn drop(&mut self) {
mem
::
transmute
(
self
.access.inner
.get
())
};
match
inner
.queue
.
shift
(
)
{
match
inner
.queue
.
remove
(
0
)
{
// Here we have found a task that was waiting for access, and we
// current have the "access lock" we need to relinquish access to
// this sleeping task.
...
...
src/libterm/terminfo/parm.rs
浏览文件 @
9db1d356
...
...
@@ -514,12 +514,12 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,String> {
FormatDigit
=>
{
if
flags
.space
&&
!
(
s
[
0
]
==
'-'
as
u8
||
s
[
0
]
==
'+'
as
u8
)
{
s
.
unshift
(
' '
as
u8
);
s
.
insert
(
0
,
' '
as
u8
);
}
}
FormatOctal
=>
{
if
flags
.alternate
&&
s
[
0
]
!=
'0'
as
u8
{
s
.
unshift
(
'0'
as
u8
);
s
.
insert
(
0
,
'0'
as
u8
);
}
}
FormatHex
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录