Skip to content

Commit fdcba4e

Browse files
Merge pull request #31 from code0-tech/main
Main to 25-verify-std-functions
2 parents c83b15b + 007c5ed commit fdcba4e

9 files changed

Lines changed: 633 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Build packages
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
taurus:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Setup rust
13+
run: rustup update --no-self-update stable
14+
- name: Build Taurus
15+
run: PATH=${{ runner.temp }}/proto/bin:$PATH cargo build
16+
env:
17+
RUST_BACKTRACE: 'full'
18+
- name: Run Tests
19+
run: cargo test

Cargo.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ lapin = "2.5.3"
1010
serde = "1.0.219"
1111
serde_json = "1.0.140"
1212
tokio = { version = "1.44.1", features = ["rt-multi-thread"] }
13+
tucana = "0.0.20"
14+
toml = "0.8.0"
15+
16+
[dev-dependencies]
17+
tempfile = "3.19.1"

src/locale/code.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#[derive(Clone, PartialEq, Debug)]
2+
pub enum CountryCode {
3+
Germany,
4+
UnitedStates,
5+
France,
6+
}
7+
8+
impl ToString for CountryCode {
9+
fn to_string(&self) -> String {
10+
match self {
11+
CountryCode::Germany => "de-DE".to_string(),
12+
CountryCode::UnitedStates => "en-US".to_string(),
13+
CountryCode::France => "fr-FR".to_string(),
14+
}
15+
}
16+
}
17+
18+
pub fn code_from_file_name(file_name: String, default: CountryCode) -> CountryCode {
19+
match file_name.as_str() {
20+
"de-DE" => CountryCode::Germany,
21+
"en-US" => CountryCode::UnitedStates,
22+
"fr-FR" => CountryCode::France,
23+
_ => default,
24+
}
25+
}

0 commit comments

Comments
 (0)