Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jpschorr committed Nov 18, 2024
1 parent 7add534 commit 27814a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion partiql-logical/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ pub enum Lit {
Double(OrderedFloat<f64>),
Bool(bool),
String(String),
BoxDocument(Vec<u8>, String),
BoxDocument(Vec<u8>, String), // (bytes, type-name as string) TODO replace with strongly typed box name.
Struct(Vec<(String, Lit)>),
Bag(Vec<Lit>),
List(Vec<Lit>),
Expand Down
12 changes: 4 additions & 8 deletions partiql-logical/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ impl From<Value> for Lit {
Value::Real(f) => Lit::Double(f),
Value::Decimal(d) => Lit::Decimal(*d),
Value::String(s) => Lit::String(*s),
Value::Blob(bytes) => {
Value::Blob(_bytes) => {
todo!("Value to Lit: Blob")
}
Value::DateTime(dt) => {
Value::DateTime(_dt) => {
todo!("Value to Lit: DateTime")
}
Value::List(list) => (*list).into(),
Expand Down Expand Up @@ -58,7 +58,7 @@ impl From<Lit> for Value {
Lit::Double(f) => Value::Real(f),
Lit::Bool(b) => Value::Boolean(b),
Lit::String(s) => Value::String(s.into()),
Lit::BoxDocument(contents, typ) => {
Lit::BoxDocument(contents, _typ) => {
parse_embedded_ion_str(&String::from_utf8_lossy(contents.as_slice()))
.expect("TODO ion parsing error")
}
Expand All @@ -71,14 +71,10 @@ impl From<Lit> for Value {
}
}

/// Represents an AST transform Error
/// Represents a Literal Value Error
#[derive(Error, Debug, Clone, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum LiteralError {
/// Indicates that there is an internal error that was not due to user input or API violation.
#[error("Illegal State: {0}")]
IllegalState(String),

/// Indicates that there was an error interpreting a literal value.
#[error("Error with literal: {literal}: {error}")]
Literal { literal: String, error: String },
Expand Down

0 comments on commit 27814a2

Please sign in to comment.