Skip to content

Commit db7c8f4

Browse files
committed
Coding style fixes
1 parent 3a6437c commit db7c8f4

File tree

4 files changed

+22
-25
lines changed

4 files changed

+22
-25
lines changed

src/librustdoc/html/render/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,11 +1386,11 @@ impl Setting {
13861386
description,
13871387
),
13881388
Setting::Select { js_data_name, description, default_value, ref options } => format!(
1389-
"<div class='setting-line'>\
1389+
"<div class=\"setting-line\">\
13901390
<div>{}</div>\
1391-
<label class='select-wrapper'>\
1392-
<select id='{}' autocomplete='off'>{}</select>\
1393-
<img src='{}down-arrow{}.svg' alt='Select item'>\
1391+
<label class=\"select-wrapper\">\
1392+
<select id=\"{}\" autocomplete=\"off\">{}</select>\
1393+
<img src=\"{}down-arrow{}.svg\" alt=\"Select item\">\
13941394
</label>\
13951395
</div>",
13961396
description,

src/librustdoc/html/static/settings.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131

3232
.select-wrapper {
3333
float: right;
34-
3534
position: relative;
36-
3735
height: 27px;
3836
min-width: 25%;
3937
}
@@ -42,23 +40,18 @@
4240
appearance: none;
4341
-moz-appearance: none;
4442
-webkit-appearance: none;
45-
4643
background: none;
4744
border: 2px solid #ccc;
4845
padding-right: 28px;
49-
5046
width: 100%;
5147
}
5248

5349
.select-wrapper img {
5450
pointer-events: none;
55-
5651
position: absolute;
5752
right: 0;
5853
bottom: 0;
59-
6054
background: #ccc;
61-
6255
height: 100%;
6356
width: 28px;
6457
padding: 0px 4px;

src/librustdoc/html/static/settings.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
// Local js definitions:
2-
/* global getCurrentValue, updateLocalStorage */
2+
/* global getCurrentValue, updateLocalStorage, updateSystemTheme */
33

44
(function () {
55
function changeSetting(settingName, value) {
6-
updateLocalStorage('rustdoc-' + settingName, value);
6+
updateLocalStorage("rustdoc-" + settingName, value);
77

88
switch (settingName) {
9-
case 'preferred-dark-theme':
10-
case 'preferred-light-theme':
11-
case 'use-system-theme':
9+
case "preferred-dark-theme":
10+
case "preferred-light-theme":
11+
case "use-system-theme":
1212
updateSystemTheme();
1313
break;
1414
}
1515
}
1616

1717
function getSettingValue(settingName) {
18-
return getCurrentValue('rustdoc-' + settingName);
18+
return getCurrentValue("rustdoc-" + settingName);
1919
}
2020

2121
function setEvents() {
2222
var elems = {
2323
toggles: document.getElementsByClassName("slider"),
2424
selects: document.getElementsByClassName("select-wrapper")
2525
};
26+
var i;
2627

2728
if (elems.toggles && elems.toggles.length > 0) {
28-
for (var i = 0; i < elems.toggles.length; ++i) {
29+
for (i = 0; i < elems.toggles.length; ++i) {
2930
var toggle = elems.toggles[i].previousElementSibling;
3031
var settingId = toggle.id;
3132
var settingValue = getSettingValue(settingId);
@@ -39,8 +40,8 @@
3940
}
4041

4142
if (elems.selects && elems.selects.length > 0) {
42-
for (var i = 0; i < elems.selects.length; ++i) {
43-
var select = elems.selects[i].getElementsByTagName('select')[0];
43+
for (i = 0; i < elems.selects.length; ++i) {
44+
var select = elems.selects[i].getElementsByTagName("select")[0];
4445
var settingId = select.id;
4546
var settingValue = getSettingValue(settingId);
4647
if (settingValue !== null) {

src/librustdoc/html/static/storage.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ function switchTheme(styleElem, mainStyleElem, newTheme, saveTheme) {
110110
});
111111
if (found === true) {
112112
styleElem.href = newHref;
113-
// If this new value comes from a system setting or from the previously saved theme, no
114-
// need to save it.
113+
// If this new value comes from a system setting or from the previously
114+
// saved theme, no need to save it.
115115
if (saveTheme === true) {
116116
updateLocalStorage("rustdoc-theme", newTheme);
117117
}
@@ -182,7 +182,10 @@ if (getCurrentValue("rustdoc-use-system-theme") !== "false" && window.matchMedia
182182
// call the function to initialize the theme at least once!
183183
updateSystemTheme();
184184
} else {
185-
switchTheme(currentTheme, mainTheme,
186-
getCurrentValue("rustdoc-theme") || "light",
187-
false);
185+
switchTheme(
186+
currentTheme,
187+
mainTheme,
188+
getCurrentValue("rustdoc-theme") || "light",
189+
false
190+
);
188191
}

0 commit comments

Comments
 (0)