Skip to content

Commit

Permalink
Fixed Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
CEbbinghaus committed Oct 21, 2023
1 parent 2732dfa commit a2834e4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
- name: Unzip Result
run: |
cd /tmp/output
unzip MicroSDeck.zip
mkdir release && cd release
unzip /tmp/output/MicroSDeck.zip
- name: Upload Artifacts to Github
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
with:
name: "MicroSDeck"
path: /tmp/output/MicroSDeck.zip
path: /release/MicroSDeck/*
12 changes: 9 additions & 3 deletions backend/src/ds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ impl StoreElement {
_ => None,
}
}
fn as_game_ref(&self) -> Option<&Game> {
match self {
Self::Game(game) => Some(&game),
_ => None,
}
}

fn as_card(&self) -> Option<MicroSDCard> {
match self {
Expand Down Expand Up @@ -197,7 +203,7 @@ impl StoreData {
.collect()
}

pub fn list_cards_with_games(&self) -> Vec<(MicroSDCard, Vec<Game>)> {
pub fn list_cards_with_games(&self) -> Vec<(MicroSDCard, Vec<&Game>)> {
self.nodes
.iter()
.filter_map(|node| {
Expand All @@ -206,7 +212,7 @@ impl StoreData {
node.1
.links
.iter()
.filter_map(|key: &DefaultKey| self.nodes[*key].element.as_game())
.filter_map(|key: &DefaultKey| self.nodes[*key].element.as_game_ref())
.collect()
})
})
Expand Down Expand Up @@ -309,7 +315,7 @@ impl Store {
self.data.lock().unwrap().list_games()
}

pub fn list_cards_with_games(&self) -> Vec<(MicroSDCard, Vec<Game>)> {
pub fn list_cards_with_games(&self) -> Vec<(MicroSDCard, Vec<&Game>)> {
self.data.lock().unwrap().list_cards_with_games()
}
}
1 change: 1 addition & 0 deletions backend/store
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"nodes":[{"value":null,"version":0},{"value":{"element":{"Game":{"uid":"foo","name":"Nothing","size":0}},"links":[{"idx":2,"version":3}]},"version":3},{"value":{"element":{"Card":{"uid":"foo","libid":"libraryid","name":"Bazzinga"}},"links":[{"idx":1,"version":3}]},"version":3}],"node_ids":{"bar":{"idx":2,"version":3},"foo":{"idx":1,"version":3}}}

0 comments on commit a2834e4

Please sign in to comment.