Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
edd26add
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,发现更多精彩内容 >>
提交
edd26add
编写于
6月 05, 2022
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update minifier version to 0.2.1
上级
fee3a459
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
8 deletion
+11
-8
Cargo.lock
Cargo.lock
+2
-2
src/librustdoc/Cargo.toml
src/librustdoc/Cargo.toml
+1
-1
src/librustdoc/html/render/write_shared.rs
src/librustdoc/html/render/write_shared.rs
+6
-4
src/librustdoc/theme.rs
src/librustdoc/theme.rs
+1
-0
src/librustdoc/theme/tests.rs
src/librustdoc/theme/tests.rs
+1
-1
未找到文件。
Cargo.lock
浏览文件 @
edd26add
...
...
@@ -2391,9 +2391,9 @@ dependencies = [
[[package]]
name = "minifier"
version = "0.
1.0
"
version = "0.
2.1
"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
7071d17e2898e134cabf624f43cdefa0cedf57c739e964df3d0df9d028701a72
"
checksum = "
ac96d1e7a65f206443f95afff6de8f1690c77c97d6fc9c9bb2d2cd0662e9ff9f
"
[[package]]
name = "minimal-lexical"
...
...
src/librustdoc/Cargo.toml
浏览文件 @
edd26add
...
...
@@ -11,7 +11,7 @@ arrayvec = { version = "0.7", default-features = false }
askama
=
{
version
=
"0.11"
,
default-features
=
false
,
features
=
["config"]
}
atty
=
"0.2"
pulldown-cmark
=
{
version
=
"0.9"
,
default-features
=
false
}
minifier
=
"0.
1.0
"
minifier
=
"0.
2.1
"
serde
=
{
version
=
"1.0"
,
features
=
["derive"]
}
serde_json
=
"1.0"
smallvec
=
"1.6.1"
...
...
src/librustdoc/html/render/write_shared.rs
浏览文件 @
edd26add
...
...
@@ -122,11 +122,13 @@ fn write_minify(
if
minify
{
let
contents
=
contents
.as_ref
();
let
contents
=
if
resource
.extension
()
==
Some
(
OsStr
::
new
(
"css"
))
{
minifier
::
css
::
minify
(
contents
)
.map_err
(|
e
|
{
Error
::
new
(
format!
(
"failed to minify CSS file: {}"
,
e
),
resource
.path
(
self
))
})
?
minifier
::
css
::
minify
(
contents
)
.map_err
(|
e
|
{
Error
::
new
(
format!
(
"failed to minify CSS file: {}"
,
e
),
resource
.path
(
self
))
})
?
.to_string
()
}
else
{
minifier
::
js
::
minify
(
contents
)
minifier
::
js
::
minify
(
contents
)
.to_string
()
};
self
.write_shared
(
resource
,
contents
,
emit
)
}
else
{
...
...
src/librustdoc/theme.rs
浏览文件 @
edd26add
...
...
@@ -185,6 +185,7 @@ fn build_rule(v: &[u8], positions: &[usize]) -> String {
.intersperse
(
" "
)
.collect
::
<
String
>
(),
)
.map
(|
css
|
css
.to_string
())
.unwrap_or_else
(|
_
|
String
::
new
())
}
...
...
src/librustdoc/theme/tests.rs
浏览文件 @
edd26add
...
...
@@ -106,7 +106,7 @@ fn check_invalid_css() {
#[test]
fn
test_with_minification
()
{
let
text
=
include_str!
(
"../html/static/css/themes/dark.css"
);
let
minified
=
minifier
::
css
::
minify
(
&
text
)
.expect
(
"CSS minification failed"
);
let
minified
=
minifier
::
css
::
minify
(
&
text
)
.expect
(
"CSS minification failed"
)
.to_string
()
;
let
against
=
load_css_paths
(
text
.as_bytes
());
let
other
=
load_css_paths
(
minified
.as_bytes
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录