Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vnotepad
Exa
提交
b0c51d93
E
Exa
项目概览
vnotepad
/
Exa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Exa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b0c51d93
编写于
9月 22, 2014
作者:
B
Ben S
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove a few deprecated constructs
The language keeps changing when I'm not looking!
上级
a2e91448
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
7 addition
and
7 deletion
+7
-7
src/exa.rs
src/exa.rs
+2
-2
src/format.rs
src/format.rs
+1
-1
src/unix.rs
src/unix.rs
+4
-4
未找到文件。
src/exa.rs
浏览文件 @
b0c51d93
...
@@ -40,7 +40,7 @@ fn exa(opts: &Options) {
...
@@ -40,7 +40,7 @@ fn exa(opts: &Options) {
// more than one of them.
// more than one of them.
let
print_dir_names
=
opts
.dirs
.len
()
>
1
;
let
print_dir_names
=
opts
.dirs
.len
()
>
1
;
for
dir_name
in
opts
.dirs
.clone
()
.
move
_iter
()
{
for
dir_name
in
opts
.dirs
.clone
()
.
into
_iter
()
{
if
first
{
if
first
{
first
=
false
;
first
=
false
;
}
}
...
@@ -128,7 +128,7 @@ fn details_view(options: &Options, columns: &Vec<Column>, files: Vec<&File>) {
...
@@ -128,7 +128,7 @@ fn details_view(options: &Options, columns: &Vec<Column>, files: Vec<&File>) {
.collect
();
.collect
();
if
options
.header
{
if
options
.header
{
table
.
unshift
(
columns
.iter
()
.map
(|
c
|
Plain
.underline
()
.paint
(
c
.header
()))
.collect
());
table
.
insert
(
0
,
columns
.iter
()
.map
(|
c
|
Plain
.underline
()
.paint
(
c
.header
()))
.collect
());
}
}
// Each column needs to have its invisible colour-formatting
// Each column needs to have its invisible colour-formatting
...
...
src/format.rs
浏览文件 @
b0c51d93
...
@@ -21,7 +21,7 @@ fn format_bytes(mut amount: f64, kilo: f64, prefixes: &[&str]) -> (String, Strin
...
@@ -21,7 +21,7 @@ fn format_bytes(mut amount: f64, kilo: f64, prefixes: &[&str]) -> (String, Strin
}
}
}
}
#[allow(non_snake_case
_functions
)]
#[allow(non_snake_case)]
pub
fn
format_IEC_bytes
(
amount
:
u64
)
->
(
String
,
String
)
{
pub
fn
format_IEC_bytes
(
amount
:
u64
)
->
(
String
,
String
)
{
format_bytes
(
amount
as
f64
,
1024.0
,
IEC_PREFIXES
)
format_bytes
(
amount
as
f64
,
1024.0
,
IEC_PREFIXES
)
}
}
...
...
src/unix.rs
浏览文件 @
b0c51d93
...
@@ -76,15 +76,15 @@ impl Unix {
...
@@ -76,15 +76,15 @@ impl Unix {
}
}
pub
fn
get_user_name
(
&
self
,
uid
:
u32
)
->
Option
<
String
>
{
pub
fn
get_user_name
(
&
self
,
uid
:
u32
)
->
Option
<
String
>
{
self
.user_names
.get
(
&
uid
)
.clone
()
self
.user_names
[
uid
]
.clone
()
}
}
pub
fn
get_group_name
(
&
self
,
gid
:
u32
)
->
Option
<
String
>
{
pub
fn
get_group_name
(
&
self
,
gid
:
u32
)
->
Option
<
String
>
{
self
.group_names
.get
(
&
gid
)
.clone
()
self
.group_names
[
gid
]
.clone
()
}
}
pub
fn
is_group_member
(
&
self
,
gid
:
u32
)
->
bool
{
pub
fn
is_group_member
(
&
self
,
gid
:
u32
)
->
bool
{
*
self
.groups
.get
(
&
gid
)
self
.groups
[
gid
]
}
}
pub
fn
load_user
(
&
mut
self
,
uid
:
u32
)
{
pub
fn
load_user
(
&
mut
self
,
uid
:
u32
)
{
...
@@ -108,7 +108,7 @@ impl Unix {
...
@@ -108,7 +108,7 @@ impl Unix {
// The second call will return None if it's a null pointer.
// The second call will return None if it's a null pointer.
loop
{
loop
{
match
unsafe
{
group
.offset
(
i
)
.
to_option
()
.unwrap
()
.to_option
()
}
{
match
unsafe
{
group
.offset
(
i
)
.
as_ref
()
.unwrap
()
.as_ref
()
}
{
Some
(
username
)
=>
{
Some
(
username
)
=>
{
if
unsafe
{
from_c_str
(
username
)
}
==
*
uname
{
if
unsafe
{
from_c_str
(
username
)
}
==
*
uname
{
return
true
;
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录