Skip to content

Commit 9f19f0e

Browse files
ci: run fmt and clippy
1 parent fb2bdc3 commit 9f19f0e

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/course_database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl FromStr for CourseId {
5151
.ok_or(anyhow!("Could not find the class id"))?
5252
.parse()?;
5353

54-
if class_id < 100 || 1000 <= class_id {
54+
if !(100..1000).contains(&class_id) {
5555
return Err(anyhow!(
5656
"Class id must be a number, at least 100 and less than 1000"
5757
));
@@ -255,7 +255,7 @@ mod tests {
255255
use super::*;
256256
use petgraph::visit::EdgeRef;
257257

258-
static CMPUT_SMALL: &'static str = r#"[
258+
static CMPUT_SMALL: &str = r#"[
259259
(
260260
id: (subject_id: "CMPUT", class_id: 101),
261261
name: "",

src/icons.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ impl Icon {
1919
}
2020
}
2121

22-
impl Into<Text<'static>> for Icon {
23-
fn into(self) -> Text<'static> {
24-
let ch = match self {
22+
impl From<Icon> for Text<'static> {
23+
fn from(val: Icon) -> Self {
24+
let ch = match val {
2525
Icon::AccountTree => "A",
2626
Icon::FullStackedBarChart => "B",
2727
Icon::SideNavigation => "C",

src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#![allow(dead_code, unused_variables)]
22

3-
use std::rc::Rc;
43
use std::sync::Arc;
54

65
use iced::alignment::Horizontal;
7-
use iced::theme::Palette;
86
use iced::widget::{button, column, container, horizontal_rule, row, text, text_input, Text};
9-
use iced::{executor, font, Application, Color, Command, Element, Length, Padding, Theme};
7+
use iced::{executor, font, Application, Color, Command, Element, Length, Theme};
108

119
use iced_aw::native::Split;
12-
use iced_aw::{modal, split, Card, BOOTSTRAP_FONT_BYTES};
10+
use iced_aw::{modal, split, Card};
1311

1412
mod course_database;
1513
use course_database::{CourseDatabase, CourseId};

0 commit comments

Comments
 (0)