Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vnotepad
Exa
提交
b0d4c972
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,发现更多精彩内容 >>
提交
b0d4c972
编写于
5月 12, 2015
作者:
B
Ben S
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Where do all these tabs keep coming from?
上级
fafeda77
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
23 deletion
+23
-23
src/colours.rs
src/colours.rs
+13
-13
src/filetype.rs
src/filetype.rs
+10
-10
未找到文件。
src/colours.rs
浏览文件 @
b0d4c972
...
...
@@ -28,19 +28,19 @@ pub struct Colours {
pub
struct
FileTypes
{
pub
normal
:
Style
,
pub
directory
:
Style
,
pub
symlink
:
Style
,
pub
special
:
Style
,
pub
executable
:
Style
,
pub
image
:
Style
,
pub
video
:
Style
,
pub
music
:
Style
,
pub
lossless
:
Style
,
pub
crypto
:
Style
,
pub
document
:
Style
,
pub
compressed
:
Style
,
pub
temp
:
Style
,
pub
immediate
:
Style
,
pub
compiled
:
Style
,
pub
symlink
:
Style
,
pub
special
:
Style
,
pub
executable
:
Style
,
pub
image
:
Style
,
pub
video
:
Style
,
pub
music
:
Style
,
pub
lossless
:
Style
,
pub
crypto
:
Style
,
pub
document
:
Style
,
pub
compressed
:
Style
,
pub
temp
:
Style
,
pub
immediate
:
Style
,
pub
compiled
:
Style
,
}
#[derive(Clone,
Copy,
Debug,
Default,
PartialEq)]
...
...
src/filetype.rs
浏览文件 @
b0d4c972
...
...
@@ -43,7 +43,7 @@ impl<'_> FileTypes for File<'_> {
"build.gradle"
,
"Rakefile"
,
"Gruntfile.js"
,
"Gruntfile.coffee"
,
])
}
}
fn
is_image
(
&
self
)
->
bool
{
self
.extension_is_one_of
(
&
[
...
...
@@ -52,33 +52,33 @@ impl<'_> FileTypes for File<'_> {
"svg"
,
"stl"
,
"eps"
,
"dvi"
,
"ps"
,
"cbr"
,
"cbz"
,
"xpm"
,
"ico"
,
])
}
}
fn
is_video
(
&
self
)
->
bool
{
self
.extension_is_one_of
(
&
[
"avi"
,
"flv"
,
"m2v"
,
"mkv"
,
"mov"
,
"mp4"
,
"mpeg"
,
"mpg"
,
"ogm"
,
"ogv"
,
"vob"
,
"wmv"
,
])
}
}
fn
is_music
(
&
self
)
->
bool
{
self
.extension_is_one_of
(
&
[
"aac"
,
"m4a"
,
"mp3"
,
"ogg"
,
"wma"
,
])
}
}
fn
is_lossless
(
&
self
)
->
bool
{
self
.extension_is_one_of
(
&
[
"alac"
,
"ape"
,
"flac"
,
"wav"
,
])
}
}
fn
is_crypto
(
&
self
)
->
bool
{
self
.extension_is_one_of
(
&
[
"zip"
,
"tar"
,
"Z"
,
"gz"
,
"bz2"
,
"a"
,
"ar"
,
"7z"
,
"iso"
,
"dmg"
,
"tc"
,
"rar"
,
"par"
,
])
}
}
fn
is_document
(
&
self
)
->
bool
{
self
.extension_is_one_of
(
&
[
...
...
@@ -86,20 +86,20 @@ impl<'_> FileTypes for File<'_> {
"odp"
,
"odt"
,
"pdf"
,
"ppt"
,
"pptx"
,
"rtf"
,
"xls"
,
"xlsx"
,
])
}
}
fn
is_compressed
(
&
self
)
->
bool
{
self
.extension_is_one_of
(
&
[
"zip"
,
"tar"
,
"Z"
,
"gz"
,
"bz2"
,
"a"
,
"ar"
,
"7z"
,
"iso"
,
"dmg"
,
"tc"
,
"rar"
,
"par"
])
}
}
fn
is_temp
(
&
self
)
->
bool
{
self
.name
.ends_with
(
"~"
)
||
(
self
.name
.starts_with
(
"#"
)
&&
self
.name
.ends_with
(
"#"
))
||
self
.extension_is_one_of
(
&
[
"tmp"
,
"swp"
,
"swo"
,
"swn"
,
"bak"
])
}
}
fn
is_compiled
(
&
self
)
->
bool
{
if
self
.extension_is_one_of
(
&
[
"class"
,
"elc"
,
"hi"
,
"o"
,
"pyc"
])
{
...
...
@@ -111,7 +111,7 @@ impl<'_> FileTypes for File<'_> {
else
{
false
}
}
}
}
#[cfg(broken_test)]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录