Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
8296699f
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,发现更多精彩内容 >>
提交
8296699f
编写于
3月 16, 2018
作者:
S
Shotaro Yamada
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary `.collect()`
上级
3525368a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
14 deletion
+9
-14
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/mod.rs
+1
-1
src/librustc_errors/emitter.rs
src/librustc_errors/emitter.rs
+1
-3
src/librustc_errors/lib.rs
src/librustc_errors/lib.rs
+2
-3
src/librustc_lint/bad_style.rs
src/librustc_lint/bad_style.rs
+3
-5
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+2
-2
未找到文件。
src/librustc/infer/error_reporting/mod.rs
浏览文件 @
8296699f
...
...
@@ -805,7 +805,7 @@ fn lifetime_display(lifetime: Region) -> String {
// Foo<_, Qux>
// ^ elided type as this type argument was the same in both sides
let
type_arguments
=
sub1
.types
()
.zip
(
sub2
.types
());
let
regions_len
=
sub1
.regions
()
.co
llect
::
<
Vec
<
_
>>
()
.len
();
let
regions_len
=
sub1
.regions
()
.co
unt
();
for
(
i
,
(
ta1
,
ta2
))
in
type_arguments
.take
(
len
)
.enumerate
()
{
let
i
=
i
+
regions_len
;
if
ta1
==
ta2
{
...
...
src/librustc_errors/emitter.rs
浏览文件 @
8296699f
...
...
@@ -528,9 +528,7 @@ fn render_source_line(&self,
// If there are no annotations or the only annotations on this line are
// MultilineLine, then there's only code being shown, stop processing.
if
line
.annotations
.is_empty
()
||
line
.annotations
.iter
()
.filter
(|
a
|
!
a
.is_line
())
.collect
::
<
Vec
<
_
>>
()
.len
()
==
0
{
if
line
.annotations
.iter
()
.all
(|
a
|
a
.is_line
())
{
return
vec!
[];
}
...
...
src/librustc_errors/lib.rs
浏览文件 @
8296699f
...
...
@@ -610,9 +610,8 @@ pub fn print_error_count(&self) {
if
can_show_explain
&&
are_there_diagnostics
{
let
mut
error_codes
=
self
.emitted_diagnostic_codes
.borrow
()
.clone
()
.into_iter
()
.filter_map
(|
x
|
match
x
{
.iter
()
.filter_map
(|
x
|
match
*
x
{
DiagnosticId
::
Error
(
ref
s
)
=>
Some
(
s
.clone
()),
_
=>
None
,
})
...
...
src/librustc_lint/bad_style.rs
浏览文件 @
8296699f
...
...
@@ -83,12 +83,10 @@ fn to_camel_case(s: &str) -> String {
}
else
{
c
.to_lowercase
()
.collect
()
})
.collect
::
<
Vec
<
_
>>
()
.concat
()
.collect
::
<
String
>
()
})
.filter
(|
x
|
!
x
.is_empty
())
.collect
::
<
Vec
<
_
>>
()
.iter
()
.fold
((
String
::
new
(),
None
),
|(
acc
,
prev
):
(
String
,
Option
<&
String
>
),
next
|
{
.fold
((
String
::
new
(),
None
),
|(
acc
,
prev
):
(
String
,
Option
<
String
>
),
next
|
{
// separate two components with an underscore if their boundary cannot
// be distinguished using a uppercase/lowercase case distinction
let
join
=
if
let
Some
(
prev
)
=
prev
{
...
...
@@ -96,7 +94,7 @@ fn to_camel_case(s: &str) -> String {
let
f
=
next
.chars
()
.next
()
.unwrap
();
!
char_has_case
(
l
)
&&
!
char_has_case
(
f
)
}
else
{
false
};
(
acc
+
if
join
{
"_"
}
else
{
""
}
+
next
,
Some
(
next
))
(
acc
+
if
join
{
"_"
}
else
{
""
}
+
&
next
,
Some
(
next
))
})
.0
}
...
...
src/librustc_resolve/lib.rs
浏览文件 @
8296699f
...
...
@@ -271,7 +271,7 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
err
}
ResolutionError
::
VariableNotBoundInPattern
(
binding_error
)
=>
{
let
target_sp
=
binding_error
.target
.iter
()
.
map
(|
x
|
*
x
)
.collect
::
<
Vec
<
_
>>
();
let
target_sp
=
binding_error
.target
.iter
()
.
cloned
(
)
.collect
::
<
Vec
<
_
>>
();
let
msp
=
MultiSpan
::
from_spans
(
target_sp
.clone
());
let
msg
=
format!
(
"variable `{}` is not bound in all patterns"
,
binding_error
.name
);
let
mut
err
=
resolver
.session
.struct_span_err_with_code
(
...
...
@@ -282,7 +282,7 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
for
sp
in
target_sp
{
err
.span_label
(
sp
,
format!
(
"pattern doesn't bind `{}`"
,
binding_error
.name
));
}
let
origin_sp
=
binding_error
.origin
.iter
()
.
map
(|
x
|
*
x
)
.collect
::
<
Vec
<
_
>>
();
let
origin_sp
=
binding_error
.origin
.iter
()
.
cloned
();
for
sp
in
origin_sp
{
err
.span_label
(
sp
,
"variable not in all patterns"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录