Skip to content

Commit

Permalink
style: fix existing formatting issues (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruancomelli authored Aug 24, 2023
1 parent 9b371fd commit f6ebc2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous Integration
name: CI

on:
push:
Expand All @@ -11,6 +11,7 @@ env:

jobs:
find-exercises:
name: Find exercises
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -22,8 +23,8 @@ jobs:
outputs:
exercises: ${{ steps.find-exercises.outputs.exercises }}

build-and-test:
name: Build and test '${{ matrix.exercise }}'
check:
name: Check '${{ matrix.exercise }}'
needs: find-exercises
runs-on: ubuntu-latest
strategy:
Expand Down
4 changes: 1 addition & 3 deletions exercism/rust/anagram/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::collections::{HashSet, HashMap};
use std::collections::{HashMap, HashSet};

type CharChounter = HashMap<char, usize>;


pub fn anagrams_for<'a>(word: &str, possible_anagrams: &[&'a str]) -> HashSet<&'a str> {
let word_lower = word.to_lowercase();
let word_letter_counts = letter_counts(&word_lower);
Expand All @@ -19,7 +18,6 @@ pub fn anagrams_for<'a>(word: &str, possible_anagrams: &[&'a str]) -> HashSet<&'
.collect()
}


fn letter_counts(word: &str) -> CharChounter {
let mut counter = CharChounter::new();

Expand Down
8 changes: 6 additions & 2 deletions exercism/rust/clock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::fmt;
const MINUTES_PER_HOUR: i32 = 60;
const MINUTES_PER_DAY: i32 = 24 * MINUTES_PER_HOUR;


#[derive(fmt::Debug, PartialEq)]
pub struct Clock(i32);

Expand All @@ -19,6 +18,11 @@ impl Clock {

impl fmt::Display for Clock {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:02}:{:02}", self.0 / MINUTES_PER_HOUR, self.0 % MINUTES_PER_HOUR)
write!(
f,
"{:02}:{:02}",
self.0 / MINUTES_PER_HOUR,
self.0 % MINUTES_PER_HOUR
)
}
}

0 comments on commit f6ebc2c

Please sign in to comment.