Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
5c849f4a
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,发现更多精彩内容 >>
提交
5c849f4a
编写于
8月 23, 2016
作者:
C
Corey Farwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary 'Primitive' prefix on `PrimitiveType` enum variants.
上级
9dde5639
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
17 deletion
+17
-17
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+10
-10
src/librustdoc/html/format.rs
src/librustdoc/html/format.rs
+7
-7
未找到文件。
src/librustdoc/clean/mod.rs
浏览文件 @
5c849f4a
...
...
@@ -1485,8 +1485,8 @@ pub enum PrimitiveType {
Str
,
Slice
,
Array
,
Primitive
Tuple
,
Primitive
RawPointer
,
Tuple
,
RawPointer
,
}
#[derive(Clone,
RustcEncodable,
RustcDecodable,
Copy,
Debug)]
...
...
@@ -1520,8 +1520,8 @@ pub fn primitive_type(&self) -> Option<PrimitiveType> {
FixedVector
(
..
)
|
BorrowedRef
{
type_
:
box
FixedVector
(
..
),
..
}
=>
{
Some
(
PrimitiveType
::
Array
)
}
Tuple
(
..
)
=>
Some
(
PrimitiveType
::
Primitive
Tuple
),
RawPointer
(
..
)
=>
Some
(
PrimitiveType
::
Primitive
RawPointer
),
Tuple
(
..
)
=>
Some
(
PrimitiveType
::
Tuple
),
RawPointer
(
..
)
=>
Some
(
PrimitiveType
::
RawPointer
),
_
=>
None
,
}
}
...
...
@@ -1563,8 +1563,8 @@ fn from_str(s: &str) -> Option<PrimitiveType> {
"f64"
=>
Some
(
PrimitiveType
::
F64
),
"array"
=>
Some
(
PrimitiveType
::
Array
),
"slice"
=>
Some
(
PrimitiveType
::
Slice
),
"tuple"
=>
Some
(
PrimitiveType
::
Primitive
Tuple
),
"pointer"
=>
Some
(
PrimitiveType
::
Primitive
RawPointer
),
"tuple"
=>
Some
(
PrimitiveType
::
Tuple
),
"pointer"
=>
Some
(
PrimitiveType
::
RawPointer
),
_
=>
None
,
}
}
...
...
@@ -1601,8 +1601,8 @@ pub fn to_string(&self) -> &'static str {
PrimitiveType
::
Char
=>
"char"
,
PrimitiveType
::
Array
=>
"array"
,
PrimitiveType
::
Slice
=>
"slice"
,
PrimitiveType
::
Primitive
Tuple
=>
"tuple"
,
PrimitiveType
::
Primitive
RawPointer
=>
"pointer"
,
PrimitiveType
::
Tuple
=>
"tuple"
,
PrimitiveType
::
RawPointer
=>
"pointer"
,
}
}
...
...
@@ -2454,8 +2454,8 @@ fn build_deref_target_impls(cx: &DocContext,
PrimitiveType
::
Str
=>
tcx
.lang_items
.str_impl
(),
PrimitiveType
::
Slice
=>
tcx
.lang_items
.slice_impl
(),
PrimitiveType
::
Array
=>
tcx
.lang_items
.slice_impl
(),
PrimitiveType
::
Primitive
Tuple
=>
None
,
PrimitiveType
::
Primitive
RawPointer
=>
tcx
.lang_items
.const_ptr_impl
(),
PrimitiveType
::
Tuple
=>
None
,
PrimitiveType
::
RawPointer
=>
tcx
.lang_items
.const_ptr_impl
(),
};
if
let
Some
(
did
)
=
did
{
if
!
did
.is_local
()
{
...
...
src/librustdoc/html/format.rs
浏览文件 @
5c849f4a
...
...
@@ -468,16 +468,16 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
}
clean
::
Tuple
(
ref
typs
)
=>
{
match
&
typs
[
..
]
{
&
[]
=>
primitive_link
(
f
,
PrimitiveType
::
Primitive
Tuple
,
"()"
),
&
[]
=>
primitive_link
(
f
,
PrimitiveType
::
Tuple
,
"()"
),
&
[
ref
one
]
=>
{
primitive_link
(
f
,
PrimitiveType
::
Primitive
Tuple
,
"("
)
?
;
primitive_link
(
f
,
PrimitiveType
::
Tuple
,
"("
)
?
;
write!
(
f
,
"{},"
,
one
)
?
;
primitive_link
(
f
,
PrimitiveType
::
Primitive
Tuple
,
")"
)
primitive_link
(
f
,
PrimitiveType
::
Tuple
,
")"
)
}
many
=>
{
primitive_link
(
f
,
PrimitiveType
::
Primitive
Tuple
,
"("
)
?
;
primitive_link
(
f
,
PrimitiveType
::
Tuple
,
"("
)
?
;
write!
(
f
,
"{}"
,
CommaSep
(
&
many
))
?
;
primitive_link
(
f
,
PrimitiveType
::
Primitive
Tuple
,
")"
)
primitive_link
(
f
,
PrimitiveType
::
Tuple
,
")"
)
}
}
}
...
...
@@ -496,11 +496,11 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
clean
::
RawPointer
(
m
,
ref
t
)
=>
{
match
**
t
{
clean
::
Generic
(
_
)
|
clean
::
ResolvedPath
{
is_generic
:
true
,
..
}
=>
{
primitive_link
(
f
,
clean
::
PrimitiveType
::
Primitive
RawPointer
,
primitive_link
(
f
,
clean
::
PrimitiveType
::
RawPointer
,
&
format!
(
"*{}{}"
,
RawMutableSpace
(
m
),
t
))
}
_
=>
{
primitive_link
(
f
,
clean
::
PrimitiveType
::
Primitive
RawPointer
,
primitive_link
(
f
,
clean
::
PrimitiveType
::
RawPointer
,
&
format!
(
"*{}"
,
RawMutableSpace
(
m
)))
?
;
write!
(
f
,
"{}"
,
t
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录