Skip to content

Commit

Permalink
Merge dev onto main
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfierrog committed Mar 23, 2024
2 parents b7b367b + f9ab480 commit 346e27f
Show file tree
Hide file tree
Showing 25 changed files with 1,027 additions and 612 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/push_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build
run: cargo build --verbose

Expand All @@ -24,6 +26,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Test
run: cargo test --verbose

Expand All @@ -34,6 +38,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Create Formatting Commit
uses: mbrobbel/rustfmt-check@master
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build
run: cargo build --verbose

Expand All @@ -28,6 +30,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Test
run: cargo test --verbose

Expand All @@ -36,6 +40,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Format Check
run: cargo fmt --verbose -- --check

Expand Down
40 changes: 40 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "gamesman-nova"
version = "0.1.5"
description = "System for efficient search of extensive-form games."
description = "System facilitating the search of extensive-form games."
authors = ["Max Fierro <maxfierro@berkeley.edu>"]
license = "GPL-3.0"
repository = "https://github.com/GamesCrafters/GamesmanNova"
Expand All @@ -28,4 +28,5 @@ exitcode = "^1"
nalgebra = "^0"
colored = "^2"
anyhow = "^1"
bitvec = "^1"
regex = "^1"
114 changes: 0 additions & 114 deletions src/database/engine/simple/mod.rs

This file was deleted.

21 changes: 12 additions & 9 deletions src/database/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use std::{error::Error, fmt};

use crate::database::object::schema::Datatype;
use crate::database::Datatype;

/* ERROR WRAPPER */

Expand All @@ -21,7 +21,7 @@ use crate::database::object::schema::Datatype;
/// of the variants of this wrapper include a field for a schema; this allows
/// consumers to provide specific errors when deserializing persisted schemas.
#[derive(Debug)]
pub enum DatabaseError<'a> {
pub enum DatabaseError {
/// An error to indicate that there was an attempt to construct a schema
/// containing two attributes with the same name.
RepeatedAttribute { name: String, table: Option<String> },
Expand All @@ -40,15 +40,15 @@ pub enum DatabaseError<'a> {
InvalidSize {
size: usize,
name: String,
data: &'a Datatype<'a>,
data: Datatype,
table: Option<String>,
},
}

impl Error for DatabaseError<'_> {}
impl Error for DatabaseError {}

impl fmt::Display for DatabaseError<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
impl fmt::Display for DatabaseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::RepeatedAttribute { name, table } => {
if let Some(t) = table {
Expand Down Expand Up @@ -106,12 +106,15 @@ impl fmt::Display for DatabaseError<'_> {
table,
} => {
let rule = match data {
Datatype::CSTR => "divisible by 8 bits",
Datatype::DPFP => "of exactly 64 bits",
Datatype::SPFP => "of exactly 32 bits",
Datatype::SINT => "greater than 1 bit",
Datatype::ENUM { map } => "of up to 8 bits",
Datatype::UINT => unreachable!("UINTs can be of any size."),
Datatype::CSTR => "divisible by 8 bits",
Datatype::UINT | Datatype::ENUM => {
unreachable!(
"UINTs and ENUMs can be of any nonzero size."
)
},
};
let data = data.to_string();
if let Some(t) = table {
Expand Down
File renamed without changes.
Loading

0 comments on commit 346e27f

Please sign in to comment.