Fix indentation and formatting
This commit is contained in:
parent
6d73024183
commit
85ae7c1f60
@ -133,8 +133,7 @@ async fn main() {
|
||||
.get_matches();
|
||||
|
||||
let address = matches.value_of("address").unwrap_or("0.0.0.0");
|
||||
let port = std::env::var("PORT")
|
||||
.unwrap_or_else(|_| matches.value_of("port").unwrap_or("8080").to_string());
|
||||
let port = std::env::var("PORT").unwrap_or_else(|_| matches.value_of("port").unwrap_or("8080").to_string());
|
||||
let hsts = matches.value_of("hsts");
|
||||
|
||||
let listener = [address, ":", &port].concat();
|
||||
|
31
src/utils.rs
31
src/utils.rs
@ -632,27 +632,12 @@ pub async fn error(req: Request<Body>, msg: String) -> Result<Response<Body>, St
|
||||
mod tests {
|
||||
use super::format_num;
|
||||
|
||||
#[test]
|
||||
fn format_num_works() {
|
||||
assert_eq!(
|
||||
format_num(567),
|
||||
("567".to_string(), "567".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1234),
|
||||
("1.2k".to_string(), "1234".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1999),
|
||||
("2.0k".to_string(), "1999".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1001),
|
||||
("1.0k".to_string(), "1001".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1_999_999),
|
||||
("2.0m".to_string(), "1999999".to_string())
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn format_num_works() {
|
||||
assert_eq!(format_num(567), ("567".to_string(), "567".to_string()));
|
||||
assert_eq!(format_num(1234), ("1.2k".to_string(), "1234".to_string()));
|
||||
assert_eq!(format_num(1999), ("2.0k".to_string(), "1999".to_string()));
|
||||
assert_eq!(format_num(1001), ("1.0k".to_string(), "1001".to_string()));
|
||||
assert_eq!(format_num(1_999_999), ("2.0m".to_string(), "1999999".to_string()));
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@
|
||||
<meta name="apple-mobile-web-app-title" content="Libreddit">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||
<!-- Android -->
|
||||
<!-- Android -->
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<!-- iOS Logo -->
|
||||
<link href="/touch-icon-iphone.png" rel="apple-touch-icon">
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% if kind == "more" && parent_kind == "t1" %}
|
||||
<a class="deeper_replies" href="{{ post_link }}{{ parent_id }}">→ More replies</a>
|
||||
{% else if kind == "t1" %}
|
||||
{% else if kind == "t1" %}
|
||||
<div id="{{ id }}" class="comment">
|
||||
<div class="comment_left">
|
||||
<p class="comment_score" title="{{ score.1 }}">{{ score.0 }}</p>
|
||||
|
@ -104,16 +104,16 @@
|
||||
<details class="panel" id="sidebar">
|
||||
<summary id="sidebar_label">Sidebar</summary>
|
||||
<div id="sidebar_contents">
|
||||
{{ sub.info }}
|
||||
{# <hr>
|
||||
<h2>Moderators</h2>
|
||||
<br>
|
||||
<ul>
|
||||
{% for moderator in sub.moderators %}
|
||||
<li><a style="color: var(--accent)" href="/u/{{ moderator }}">{{ moderator }}</a></li>
|
||||
{% endfor %}
|
||||
</ul> #}
|
||||
</div>
|
||||
{{ sub.info }}
|
||||
{# <hr>
|
||||
<h2>Moderators</h2>
|
||||
<br>
|
||||
<ul>
|
||||
{% for moderator in sub.moderators %}
|
||||
<li><a style="color: var(--accent)" href="/u/{{ moderator }}">{{ moderator }}</a></li>
|
||||
{% endfor %}
|
||||
</ul> #}
|
||||
</div>
|
||||
</details>
|
||||
</aside>
|
||||
{% endif %}
|
||||
|
@ -87,7 +87,7 @@
|
||||
</p>
|
||||
<!-- POST MEDIA/THUMBNAIL -->
|
||||
{% if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "image" %}
|
||||
<a href="{{ post.media.url }}" class="post_media_image {% if post.media.height / post.media.width < 2 %}short{% endif %}" >
|
||||
<a href="{{ post.media.url }}" class="post_media_image {% if post.media.height / post.media.width < 2 %}short{% endif %}" >
|
||||
<svg
|
||||
width="{{ post.media.width }}px"
|
||||
height="{{ post.media.height }}px"
|
||||
@ -119,7 +119,7 @@
|
||||
</svg>
|
||||
{% else %}
|
||||
<svg width="{{ post.thumbnail.width }}px" height="{{ post.thumbnail.height }}px" xmlns="http://www.w3.org/2000/svg">
|
||||
<image width="100%" height="100%" href="{{ post.thumbnail.url }}"/>
|
||||
<image width="100%" height="100%" href="{{ post.thumbnail.url }}"/>
|
||||
<desc>
|
||||
<img loading="lazy" alt="Thumbnail" src="{{ post.thumbnail.url }}"/>
|
||||
</desc>
|
||||
|
@ -4,10 +4,10 @@
|
||||
{% block content %}
|
||||
<div id="wall">
|
||||
<h1>{{ title }}</h1>
|
||||
<br>
|
||||
<br>
|
||||
<p>{{ msg }}</p>
|
||||
<form action="/r/{{ sub }}?redir={{ url }}" method="POST">
|
||||
<form action="/r/{{ sub }}?redir={{ url }}" method="POST">
|
||||
<input id="save" type="submit" value="Continue">
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user