Skip to content

Commit

Permalink
chore: clippy, dependabot, actions
Browse files Browse the repository at this point in the history
  • Loading branch information
foxyseta committed Jun 18, 2024
1 parent 769e9a6 commit 19926ff
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ updates:
- dependency-name: "json/config"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
16 changes: 16 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/cargo@v1
with:
command: clippy
<<<<<<< Updated upstream

- uses: actions-rs/cargo@v1
with:
command: fix

- uses: actions-rs/cargo@v1
with:
command: fmt
=======
args: --release
>>>>>>> Stashed changes

- uses: actions-rs/cargo@v1
with:
command: run
Expand Down
5 changes: 2 additions & 3 deletions src/degrees/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const DEGREES_PATH: &str = "config/degrees.json";

fn parse_degree(predegree: &Predegree, academic_year: u32) -> Degree {
let Predegree { name, id, code } = predegree;
let unibo_slug = name.replace("", "");
let unibo_slug = name.replace(" ", "");
Degree {
name: name.to_string(),
slug: id.to_string(),
Expand Down Expand Up @@ -75,8 +75,7 @@ pub fn analyze_degree(
.children()
.filter_map(|f| f.value().as_element())
.find(|r| r.name() == "a")
.map(|a_el| a_el.attr("href"))
.flatten();
.and_then(|a_el| a_el.attr("href"));
let teaching_url = match a_el {
Some(a) => a,
None => {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main() -> Result<(), eyre::Report> {
&output_dir.join(format!("degree-{}.adoc", slug)),
&url,
)?;
write!(index, "* xref:degree-{}.adoc[{}]\n", slug, name)?;
writeln!(index, "* xref:degree-{}.adoc[{}]", slug, name)?;
}
fs::write(output_dir.join("index.adoc"), index)?;
Ok(())
Expand Down

0 comments on commit 19926ff

Please sign in to comment.