Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
64234b35
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
64234b35
编写于
12月 14, 2014
作者:
J
Jorge Aparicio
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libterm: use `#[deriving(Copy)]`
上级
86f8c127
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
14 deletion
+5
-14
src/libterm/lib.rs
src/libterm/lib.rs
+1
-3
src/libterm/terminfo/parm.rs
src/libterm/terminfo/parm.rs
+4
-11
未找到文件。
src/libterm/lib.rs
浏览文件 @
64234b35
...
...
@@ -165,13 +165,13 @@ pub mod color {
/// Terminal attributes
pub
mod
attr
{
pub
use
self
::
Attr
::
*
;
use
std
::
kinds
::
Copy
;
/// Terminal attributes for use with term.attr().
///
/// Most attributes can only be turned on and must be turned off with term.reset().
/// The ones that can be turned off explicitly take a boolean value.
/// Color is also represented as an attribute for convenience.
#[deriving(Copy)]
pub
enum
Attr
{
/// Bold (or possibly bright) mode
Bold
,
...
...
@@ -194,8 +194,6 @@ pub enum Attr {
/// Convenience attribute to set the background color
BackgroundColor
(
super
::
color
::
Color
)
}
impl
Copy
for
Attr
{}
}
/// A terminal with similar capabilities to an ANSI Terminal
...
...
src/libterm/terminfo/parm.rs
浏览文件 @
64234b35
...
...
@@ -16,7 +16,7 @@
use
self
::
FormatOp
::
*
;
use
std
::
mem
::
replace
;
#[deriving(PartialEq)]
#[deriving(
Copy,
PartialEq)]
enum
States
{
Nothing
,
Percent
,
...
...
@@ -33,17 +33,13 @@ enum States {
SeekIfEndPercent
(
int
)
}
impl
Copy
for
States
{}
#[deriving(PartialEq)]
#[deriving(Copy,
PartialEq)]
enum
FormatState
{
FormatStateFlags
,
FormatStateWidth
,
FormatStatePrecision
}
impl
Copy
for
FormatState
{}
/// Types of parameters a capability can use
#[allow(missing_docs)]
#[deriving(Clone)]
...
...
@@ -446,7 +442,7 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
Ok
(
output
)
}
#[deriving(PartialEq)]
#[deriving(
Copy,
PartialEq)]
struct
Flags
{
width
:
uint
,
precision
:
uint
,
...
...
@@ -456,8 +452,6 @@ struct Flags {
space
:
bool
}
impl
Copy
for
Flags
{}
impl
Flags
{
fn
new
()
->
Flags
{
Flags
{
width
:
0
,
precision
:
0
,
alternate
:
false
,
...
...
@@ -465,6 +459,7 @@ fn new() -> Flags {
}
}
#[deriving(Copy)]
enum
FormatOp
{
FormatDigit
,
FormatOctal
,
...
...
@@ -473,8 +468,6 @@ enum FormatOp {
FormatString
}
impl
Copy
for
FormatOp
{}
impl
FormatOp
{
fn
from_char
(
c
:
char
)
->
FormatOp
{
match
c
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录