Skip to content

Commit

Permalink
Fixing Clippy Issues (#50)
Browse files Browse the repository at this point in the history
* fixing clippy issues

* Moved semver check to clippy job

* Fixed redundant imports

* fmt
  • Loading branch information
folkengine committed Mar 23, 2024
1 parent c6ce5b0 commit bcb3f1e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 16 deletions.
5 changes: 0 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
FROM mcr.microsoft.com/devcontainers/rust:latest

# install a few tools for more convenient developing
#RUN apt-get update; \
# apt-get -y install --fix-missing \
# git python3 cmake g++ python-is-python3

# [Optional] Uncomment this section to install additional packages.
#RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends python-is-python3
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
Expand All @@ -41,7 +39,10 @@ jobs:
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cardpack"
description = "Generic Deck of Cards"
version = "0.5.0"
version = "0.5.1"
authors = ["electronicpanopticon <[email protected]>"]
repository = "https://github.com/ImperialBower/cardpack.rs.git"
homepage = "https://github.com/ImperialBower/cardpack.rs"
Expand Down
9 changes: 4 additions & 5 deletions src/cards/pile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::collections::HashMap;
use std::collections::HashSet;
use std::fmt;
use std::fmt::Write;
use std::iter::FromIterator;
use unic_langid::LanguageIdentifier;

use crate::cards::card::Card;
Expand Down Expand Up @@ -223,8 +222,8 @@ impl Pile {
}

fn fold_in(&mut self, suits: &[Suit], ranks: &[Rank]) {
for (_, suit) in suits.iter().enumerate() {
for (_, rank) in ranks.iter().enumerate() {
for suit in suits {
for rank in ranks {
self.push(Card::new(*rank, *suit));
}
}
Expand Down Expand Up @@ -624,13 +623,13 @@ impl Pile {
let (_, major_arcana_suit) = arcana_suits_enumerator.next().unwrap();

// Generate Major Arcana
for (_, rank) in major_arcana_ranks.iter().enumerate() {
for rank in &major_arcana_ranks {
cards.push(Card::new(*rank, *major_arcana_suit));
}

// Generate Minor Arcana
for (_, suit) in arcana_suits_enumerator {
for (_, rank) in minor_arcana_ranks.iter().enumerate() {
for rank in &minor_arcana_ranks {
cards.push(Card::new(*rank, *suit));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cards/rank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl Named for Rank {
#[allow(non_snake_case)]
mod rank_tests {
use super::*;
use crate::{GERMAN, US_ENGLISH};
use crate::GERMAN;
use rstest::rstest;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/cards/suit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl Named for Suit {
#[allow(non_snake_case)]
mod suit_tests {
use super::*;
use crate::{GERMAN, US_ENGLISH};
use crate::GERMAN;
use rstest::rstest;

#[test]
Expand Down

0 comments on commit bcb3f1e

Please sign in to comment.