Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
criminosis committed Oct 25, 2024
1 parent 32b47ac commit 815767a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
12 changes: 9 additions & 3 deletions gremlin-client/src/io/graph_binary_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ impl GraphBinaryV1Deser for bool {
match bytes.next() {
Some(0x00) => Ok(false),
Some(0x01) => Ok(true),
other => Err(GremlinError::Cast(format!("No boolean value byte {other:?}"))),
other => Err(GremlinError::Cast(format!(
"No boolean value byte {other:?}"
))),
}
}
}
Expand Down Expand Up @@ -492,7 +494,9 @@ impl GraphBinaryV1Deser for GValue {
//Need to confirm the null-ness with the next byte being a 1
match bytes.next().cloned() {
Some(VALUE_NULL_FLAG) => Ok(GValue::Null),
other => Err(GremlinError::Cast(format!("Not expected null value byte {other:?}"))),
other => Err(GremlinError::Cast(format!(
"Not expected null value byte {other:?}"
))),
}
}
other => unimplemented!("TODO {other}"),
Expand All @@ -508,7 +512,9 @@ impl GraphBinaryV1Deser for T {
Some(GValue::String(literal)) if literal.eq_ignore_ascii_case("key") => Ok(T::Id),
Some(GValue::String(literal)) if literal.eq_ignore_ascii_case("label") => Ok(T::Id),
Some(GValue::String(literal)) if literal.eq_ignore_ascii_case("value") => Ok(T::Id),
other => Err(GremlinError::Cast(format!("Unexpected T literal {other:?}"))),
other => Err(GremlinError::Cast(format!(
"Unexpected T literal {other:?}"
))),
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion gremlin-client/src/structure/gid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ impl TryFrom<GValue> for GID {
GValue::Int32(v) => Ok(GID::Int32(v)),
GValue::Int64(v) => Ok(GID::Int64(v)),
GValue::String(v) => Ok(GID::String(v)),
other => Err(GremlinError::Cast(format!("Invalid GValue for GID {other:?}")))
other => Err(GremlinError::Cast(format!(
"Invalid GValue for GID {other:?}"
))),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions gremlin-client/src/structure/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ impl From<GKey> for GValue {
GKey::Token(s) => GValue::String(s.value().clone()),
GKey::Vertex(v) => GValue::Vertex(v),
GKey::Edge(v) => GValue::Edge(v),
GKey::Int64(v) => GValue::Int64(v),
GKey::Int32(v) => GValue::Int32(v),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gremlin-client/tests/graph_binary_read_write_cycle.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::array::IntoIter;
use std::collections::{HashSet, HashMap};
use std::collections::{HashMap, HashSet};

use chrono::{DateTime, TimeZone, Utc};
use common::io::graph_serializer;
Expand All @@ -10,8 +10,8 @@ use gremlin_client::{
GValue, IoProtocol,
};
use rstest::rstest;
use uuid::Uuid;
use std::iter::FromIterator;
use uuid::Uuid;

mod common;

Expand Down

0 comments on commit 815767a

Please sign in to comment.