Skip to content

Commit

Permalink
Merge pull request #11 from tadeokondrak/ci
Browse files Browse the repository at this point in the history
ci: init
  • Loading branch information
GenericConfluent authored Mar 3, 2024
2 parents ef106e2 + 753dd9b commit 6d456e1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
workflow_dispatch:

env:
CI: 1
RUST_BACKTRACE: short
RUSTFLAGS: -D warnings

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- run: cargo clippy
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- uses: actions-rust-lang/rustfmt@v1
6 changes: 2 additions & 4 deletions src/course_database.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use anyhow::anyhow;
use core::str::FromStr;
use petgraph::graph::{DiGraph, NodeIndex};
use petgraph::Graph;
use petgraph::graph::{Graph, NodeIndex};
use serde::Deserialize;
use std::collections::HashMap;
use std::fmt;
use std::io::BufReader;

Check failure on line 6 in src/course_database.rs

View workflow job for this annotation

GitHub Actions / test

unused import: `std::io::BufReader`

Check failure on line 6 in src/course_database.rs

View workflow job for this annotation

GitHub Actions / lint

unused import: `std::io::BufReader`

Expand Down Expand Up @@ -41,7 +39,7 @@ impl FromStr for CourseId {
fn from_str(value: &str) -> Result<Self, Self::Err> {
let mut pieces = value
.split_whitespace()
.filter(|string| string.trim_start().len() != 0);
.filter(|string| !string.trim_start().is_empty());

Ok(CourseId {
subject_id: pieces
Expand Down
2 changes: 1 addition & 1 deletion src/graph_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ where
}

fn state(&self) -> tree::State {
tree::State::new(State::default())
tree::State::new(State)
}

fn size(&self) -> Size<Length> {
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(dead_code, unused_variables)]

use iced::theme::Palette;
use iced::widget::{button, column, container, horizontal_rule, row, text, text_input};
use iced::{executor, Application, Color, Command, Element, Length, Theme};
Expand Down

0 comments on commit 6d456e1

Please sign in to comment.