Skip to content

Commit 47797bc

Browse files
authored
Make clippy happy (#58)
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
1 parent e3ebd83 commit 47797bc

File tree

4 files changed

+9
-17
lines changed

4 files changed

+9
-17
lines changed

gitjobs-server/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![warn(clippy::all, clippy::pedantic)]
2-
#![allow(clippy::cmp_owned)]
32

43
use std::{path::PathBuf, sync::Arc};
54

gitjobs-server/src/templates/auth.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ use axum_messages::Message;
44
use rinja::Template;
55
use serde::{Deserialize, Serialize};
66

7-
use crate::auth::UserSummary;
8-
9-
use crate::templates::filters;
7+
use crate::{auth::UserSummary, templates::filters};
108

119
/// Log in page.
1210
#[derive(Debug, Clone, Template, Serialize, Deserialize)]

gitjobs-server/templates/dashboard/employer/jobs/preview.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,7 @@
234234
{# Job details content #}
235235
{% macro job_details_content(text, icon = "", extra_styles = "") %}
236236
<div class="flex items-center text-xs">
237-
{% if icon.to_string() != "" %}
238-
<div class="svg-icon size-3 icon-{{ icon }} bg-gray-500 me-2"></div>
239-
{% endif %}
237+
{% if !icon.is_empty() %}<div class="svg-icon size-3 icon-{{ icon }} bg-gray-500 me-2"></div>{% endif %}
240238
<div class="truncate {{ extra_styles }}">{{ text }}</div>
241239
</div>
242240
{% endmacro job_details_content %}

gitjobs-server/templates/macros.html

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@
167167
{# djlint:off H008 #}
168168
{% match status %}
169169
{% when JobStatus::Archived %}
170-
<span class='bg-red-100 text-red-800 text-{{ size }} {%- if size.to_string() == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span>
170+
<span class='bg-red-100 text-red-800 text-{{ size }} {%- if size == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span>
171171
{% when JobStatus::Draft %}
172-
<span class='bg-blue-100 text-blue-800 text-{{ size }} {%- if size.to_string() == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span>
172+
<span class='bg-blue-100 text-blue-800 text-{{ size }} {%- if size == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span>
173173
{% when JobStatus::Published %}
174-
<span class='bg-green-100 text-green-800 text-{{ size }} {%- if size.to_string() == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span>
174+
<span class='bg-green-100 text-green-800 text-{{ size }} {%- if size == "xs" %} px-2.5 py-0.5 {%- else %} px-3 py-1 {%- endif %} rounded-full capitalize tracking-wide'>{{ status }}</span>
175175
{% endmatch %}
176176
{# djlint:on H008 #}
177177
{% endmacro job_status_badge %}
@@ -201,16 +201,15 @@
201201

202202
{# Select option #}
203203
{% macro select_option(value, label, selected = "") %}
204-
<option value="{{ value }}"
205-
{% if value.to_string() == selected.to_string() %}selected{% endif %}>{{ label }}</option>
204+
<option value="{{ value }}" {% if value == selected|ref %}selected{% endif %}>{{ label }}</option>
206205
{% endmacro select_option %}
207206
{# End select option #}
208207

209208
{# Badge #}
210209
{% macro badge(content, content_styles = "", icon = "") %}
211210
<div class="inline-flex bg-gray-100 text-gray-800 text-sm/4 font-medium px-2.5 py-1.5 rounded-full border">
212211
<div class="flex items-center">
213-
{% if icon.to_string() != "" %}
212+
{% if !icon.is_empty() %}
214213
<div class="me-2">
215214
<div class="svg-icon size-4 icon-{{ icon }} bg-gray-500"></div>
216215
</div>
@@ -300,9 +299,7 @@
300299
{# Form title #}
301300
{% macro form_title(title, description = "") %}
302301
<div class="text-xl lg:text-2xl font-medium text-gray-900">{{ title }}</div>
303-
{% if description.to_string() != "" %}
304-
<p class="mt-1 text-sm/6 text-gray-500">{{ description }}</p>
305-
{% endif %}
302+
{% if !description.is_empty() %}<p class="mt-1 text-sm/6 text-gray-500">{{ description }}</p>{% endif %}
306303
{% endmacro form_title %}
307304
{# End form title #}
308305

@@ -317,7 +314,7 @@
317314
value="{{ value }}"
318315
name="{{ name }}"
319316
class="radio-primary"
320-
{% if value.to_string() == checked.to_string() %}checked{% endif %}
317+
{% if value == checked %}checked{% endif %}
321318
{% if required %}required{% endif %}>
322319
</div>
323320
{% endmacro radio_box %}

0 commit comments

Comments
 (0)