Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vnotepad
Exa
提交
e059fb5b
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,发现更多精彩内容 >>
提交
e059fb5b
编写于
3月 31, 2017
作者:
D
Daniel Lockyer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary reference
上级
da3061d1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
13 deletion
+13
-13
src/fs/dir.rs
src/fs/dir.rs
+2
-2
src/fs/file.rs
src/fs/file.rs
+1
-1
src/options/mod.rs
src/options/mod.rs
+3
-3
src/output/details.rs
src/output/details.rs
+3
-3
src/output/grid.rs
src/output/grid.rs
+1
-1
src/output/mod.rs
src/output/mod.rs
+3
-3
未找到文件。
src/fs/dir.rs
浏览文件 @
e059fb5b
...
@@ -48,13 +48,13 @@ impl Dir {
...
@@ -48,13 +48,13 @@ impl Dir {
pub
fn
files
<
'dir
>
(
&
'dir
self
)
->
Files
<
'dir
>
{
pub
fn
files
<
'dir
>
(
&
'dir
self
)
->
Files
<
'dir
>
{
Files
{
Files
{
inner
:
self
.contents
.iter
(),
inner
:
self
.contents
.iter
(),
dir
:
&
self
,
dir
:
self
,
}
}
}
}
/// Whether this directory contains a file with the given path.
/// Whether this directory contains a file with the given path.
pub
fn
contains
(
&
self
,
path
:
&
Path
)
->
bool
{
pub
fn
contains
(
&
self
,
path
:
&
Path
)
->
bool
{
self
.contents
.iter
()
.any
(|
ref
p
|
p
.as_path
()
==
path
)
self
.contents
.iter
()
.any
(|
p
|
p
.as_path
()
==
path
)
}
}
/// Append a path onto the path specified by this directory.
/// Append a path onto the path specified by this directory.
...
...
src/fs/file.rs
浏览文件 @
e059fb5b
...
@@ -403,7 +403,7 @@ impl<'dir> File<'dir> {
...
@@ -403,7 +403,7 @@ impl<'dir> File<'dir> {
impl
<
'a
>
AsRef
<
File
<
'a
>>
for
File
<
'a
>
{
impl
<
'a
>
AsRef
<
File
<
'a
>>
for
File
<
'a
>
{
fn
as_ref
(
&
self
)
->
&
File
<
'a
>
{
fn
as_ref
(
&
self
)
->
&
File
<
'a
>
{
&
self
self
}
}
}
}
...
...
src/options/mod.rs
浏览文件 @
e059fb5b
...
@@ -138,9 +138,9 @@ impl Options {
...
@@ -138,9 +138,9 @@ impl Options {
/// Determines the complete set of options based on the given command-line
/// Determines the complete set of options based on the given command-line
/// arguments, after they’ve been parsed.
/// arguments, after they’ve been parsed.
fn
deduce
(
matches
:
&
getopts
::
Matches
)
->
Result
<
Options
,
Misfire
>
{
fn
deduce
(
matches
:
&
getopts
::
Matches
)
->
Result
<
Options
,
Misfire
>
{
let
dir_action
=
DirAction
::
deduce
(
&
matches
)
?
;
let
dir_action
=
DirAction
::
deduce
(
matches
)
?
;
let
filter
=
FileFilter
::
deduce
(
&
matches
)
?
;
let
filter
=
FileFilter
::
deduce
(
matches
)
?
;
let
view
=
View
::
deduce
(
&
matches
,
filter
.clone
(),
dir_action
)
?
;
let
view
=
View
::
deduce
(
matches
,
filter
.clone
(),
dir_action
)
?
;
Ok
(
Options
{
Ok
(
Options
{
dir_action
:
dir_action
,
dir_action
:
dir_action
,
...
...
src/output/details.rs
浏览文件 @
e059fb5b
...
@@ -207,7 +207,7 @@ impl Details {
...
@@ -207,7 +207,7 @@ impl Details {
// Build the table to put rows in.
// Build the table to put rows in.
let
mut
table
=
Table
{
let
mut
table
=
Table
{
columns
:
&*
columns_for_dir
,
columns
:
&*
columns_for_dir
,
opts
:
&
self
,
opts
:
self
,
env
:
env
,
env
:
env
,
rows
:
Vec
::
new
(),
rows
:
Vec
::
new
(),
};
};
...
@@ -306,7 +306,7 @@ impl Details {
...
@@ -306,7 +306,7 @@ impl Details {
let
mut
width
=
DisplayWidth
::
from
(
&*
egg
.file.name
);
let
mut
width
=
DisplayWidth
::
from
(
&*
egg
.file.name
);
if
egg
.file.dir
.is_none
()
{
if
egg
.file.dir
.is_none
()
{
if
let
Some
(
ref
parent
)
=
egg
.file.path
.parent
()
{
if
let
Some
(
parent
)
=
egg
.file.path
.parent
()
{
width
=
width
+
1
+
DisplayWidth
::
from
(
parent
.to_string_lossy
()
.as_ref
());
width
=
width
+
1
+
DisplayWidth
::
from
(
parent
.to_string_lossy
()
.as_ref
());
}
}
}
}
...
@@ -456,7 +456,7 @@ impl<'a, U: Users+Groups+'a> Table<'a, U> {
...
@@ -456,7 +456,7 @@ impl<'a, U: Users+Groups+'a> Table<'a, U> {
let
mut
width
=
DisplayWidth
::
from
(
&*
file
.name
);
let
mut
width
=
DisplayWidth
::
from
(
&*
file
.name
);
if
file
.dir
.is_none
()
{
if
file
.dir
.is_none
()
{
if
let
Some
(
ref
parent
)
=
file
.path
.parent
()
{
if
let
Some
(
parent
)
=
file
.path
.parent
()
{
width
=
width
+
1
+
DisplayWidth
::
from
(
parent
.to_string_lossy
()
.as_ref
());
width
=
width
+
1
+
DisplayWidth
::
from
(
parent
.to_string_lossy
()
.as_ref
());
}
}
}
}
...
...
src/output/grid.rs
浏览文件 @
e059fb5b
...
@@ -31,7 +31,7 @@ impl Grid {
...
@@ -31,7 +31,7 @@ impl Grid {
let
mut
width
=
DisplayWidth
::
from
(
&*
file
.name
);
let
mut
width
=
DisplayWidth
::
from
(
&*
file
.name
);
if
file
.dir
.is_none
()
{
if
file
.dir
.is_none
()
{
if
let
Some
(
ref
parent
)
=
file
.path
.parent
()
{
if
let
Some
(
parent
)
=
file
.path
.parent
()
{
width
=
width
+
1
+
DisplayWidth
::
from
(
parent
.to_string_lossy
()
.as_ref
());
width
=
width
+
1
+
DisplayWidth
::
from
(
parent
.to_string_lossy
()
.as_ref
());
}
}
}
}
...
...
src/output/mod.rs
浏览文件 @
e059fb5b
...
@@ -23,7 +23,7 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> TextCellContents
...
@@ -23,7 +23,7 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> TextCellContents
let
mut
bits
=
Vec
::
new
();
let
mut
bits
=
Vec
::
new
();
if
file
.dir
.is_none
()
{
if
file
.dir
.is_none
()
{
if
let
Some
(
ref
parent
)
=
file
.path
.parent
()
{
if
let
Some
(
parent
)
=
file
.path
.parent
()
{
let
coconut
=
parent
.components
()
.count
();
let
coconut
=
parent
.components
()
.count
();
if
coconut
==
1
&&
parent
.has_root
()
{
if
coconut
==
1
&&
parent
.has_root
()
{
...
@@ -37,7 +37,7 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> TextCellContents
...
@@ -37,7 +37,7 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> TextCellContents
}
}
if
!
file
.name
.is_empty
()
{
if
!
file
.name
.is_empty
()
{
bits
.push
(
file_colour
(
colours
,
&
file
)
.paint
(
file
.name
.clone
()));
bits
.push
(
file_colour
(
colours
,
file
)
.paint
(
file
.name
.clone
()));
}
}
if
links
&&
file
.is_link
()
{
if
links
&&
file
.is_link
()
{
...
@@ -47,7 +47,7 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> TextCellContents
...
@@ -47,7 +47,7 @@ pub fn filename(file: &File, colours: &Colours, links: bool) -> TextCellContents
bits
.push
(
colours
.punctuation
.paint
(
"->"
));
bits
.push
(
colours
.punctuation
.paint
(
"->"
));
bits
.push
(
Style
::
default
()
.paint
(
" "
));
bits
.push
(
Style
::
default
()
.paint
(
" "
));
if
let
Some
(
ref
parent
)
=
target
.path
.parent
()
{
if
let
Some
(
parent
)
=
target
.path
.parent
()
{
let
coconut
=
parent
.components
()
.count
();
let
coconut
=
parent
.components
()
.count
();
if
coconut
==
1
&&
parent
.has_root
()
{
if
coconut
==
1
&&
parent
.has_root
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录