Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
62337f28
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,发现更多精彩内容 >>
提交
62337f28
编写于
12月 23, 2020
作者:
M
Matthias Krüger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove duplicate code and other cleanup
上级
22824d21
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
19 deletion
+14
-19
clippy_dev/Cargo.toml
clippy_dev/Cargo.toml
+2
-2
clippy_dev/src/crater.rs
clippy_dev/src/crater.rs
+11
-17
mini-crater/logs.txt
mini-crater/logs.txt
+1
-0
未找到文件。
clippy_dev/Cargo.toml
浏览文件 @
62337f28
[package]
authors
=
[
"Philipp Hansch <dev@phansch.net>"
]
edition
=
"2018"
name
=
"clippy_dev"
version
=
"0.0.1"
authors
=
[
"Philipp Hansch <dev@phansch.net>"
]
edition
=
"2018"
[dependencies]
bytecount
=
"0.6"
...
...
clippy_dev/src/crater.rs
浏览文件 @
62337f28
...
...
@@ -14,8 +14,14 @@
use
serde
::{
Deserialize
,
Serialize
};
// crate data we stored in the toml, can have multiple versions.
// if so, one TomlKrate maps to several KrateSources
// use this to store the crates when interacting with the crates.toml file
#[derive(Debug,
Serialize,
Deserialize)]
struct
CrateList
{
crates
:
HashMap
<
String
,
Vec
<
String
>>
,
}
// crate data we stored in the toml, can have multiple versions per crate
// A single TomlCrate is laster mapped to several CrateSources in that case
struct
TomlCrate
{
name
:
String
,
versions
:
Vec
<
String
>
,
...
...
@@ -28,12 +34,6 @@ struct CrateSource {
version
:
String
,
}
// use this to store the crates when interacting with the crates.toml file
#[derive(Debug,
Serialize,
Deserialize)]
struct
CrateList
{
crates
:
HashMap
<
String
,
Vec
<
String
>>
,
}
// represents the extracted sourcecode of a crate
#[derive(Debug)]
struct
Crate
{
...
...
@@ -70,14 +70,8 @@ fn download_and_extract(&self) -> Crate {
// unzip the tarball
let
ungz_tar
=
flate2
::
read
::
GzDecoder
::
new
(
std
::
fs
::
File
::
open
(
&
krate_file_path
)
.unwrap
());
// extract the tar archive
let
mut
archiv
=
tar
::
Archive
::
new
(
ungz_tar
);
archiv
.unpack
(
&
extract_dir
)
.expect
(
"Failed to extract!"
);
// unzip the tarball
let
ungz_tar
=
flate2
::
read
::
GzDecoder
::
new
(
std
::
fs
::
File
::
open
(
&
krate_file_path
)
.unwrap
());
// extract the tar archive
let
mut
archiv
=
tar
::
Archive
::
new
(
ungz_tar
);
archiv
.unpack
(
&
extract_dir
)
.expect
(
"Failed to extract!"
);
let
mut
archive
=
tar
::
Archive
::
new
(
ungz_tar
);
archive
.unpack
(
&
extract_dir
)
.expect
(
"Failed to extract!"
);
}
// crate is extracted, return a new Krate object which contains the path to the extracted
// sources that clippy can check
...
...
@@ -132,7 +126,7 @@ fn run_clippy_lints(&self, cargo_clippy_path: &PathBuf) -> Vec<String> {
})
.collect
();
// sort messages alphabtically to avoid noise in the logs
// sort messages alphab
e
tically to avoid noise in the logs
output
.sort
();
output
}
...
...
mini-crater/logs.txt
浏览文件 @
62337f28
...
...
@@ -1423,6 +1423,7 @@ iron-0.6.1/src/request/mod.rs:85:24: binding's name is too similar to existing b
iron-0.6.1/src/request/url.rs:109:5: this method could have a `#[must_use]` attribute
iron-0.6.1/src/request/url.rs:117:5: this method could have a `#[must_use]` attribute
iron-0.6.1/src/request/url.rs:124:9: use of deprecated macro `try`: use the `?` operator instead
iron-0.6.1/src/request/url.rs:129:1: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
iron-0.6.1/src/request/url.rs:21:14: you should put bare URLs between `<`/`>` or make a proper Markdown link
iron-0.6.1/src/request/url.rs:22:5: docs for function returning `Result` missing `# Errors` section
iron-0.6.1/src/request/url.rs:31:5: docs for function returning `Result` missing `# Errors` section
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录