Skip to content

Commit

Permalink
adjust imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JojiiOfficial committed Apr 25, 2024
1 parent f88afa8 commit 4e0a8e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use crate::qdrant::value::Kind;
use crate::qdrant::value::Kind::*;
use crate::qdrant::{ListValue, Struct, Value};
use std::error::Error;
use std::fmt::{Debug, Display, Formatter};
use std::marker::PhantomData;

/// An error for failed conversions (e.g. calling `String::try_from(v)`
/// on an integer [`Value`](crate::Value))
/// on an integer [`Value`](Value))
pub struct NotA<T> {
marker: PhantomData<T>,
}
Expand Down Expand Up @@ -64,7 +64,7 @@ impl TryFrom<Value> for bool {
type Error = NotA<bool>;

fn try_from(v: Value) -> Result<Self, NotA<bool>> {
if let Some(Kind::BoolValue(t)) = v.kind {
if let Some(BoolValue(t)) = v.kind {
Ok(t)
} else {
Err(NotA::default())
Expand All @@ -91,7 +91,7 @@ impl TryFrom<Value> for i64 {
type Error = NotA<i64>;

fn try_from(v: Value) -> Result<Self, NotA<i64>> {
if let Some(Kind::IntegerValue(t)) = v.kind {
if let Some(IntegerValue(t)) = v.kind {
Ok(t)
} else {
Err(NotA::default())
Expand All @@ -118,7 +118,7 @@ impl TryFrom<Value> for f64 {
type Error = NotA<f64>;

fn try_from(v: Value) -> Result<Self, NotA<f64>> {
if let Some(Kind::DoubleValue(t)) = v.kind {
if let Some(DoubleValue(t)) = v.kind {
Ok(t)
} else {
Err(NotA::default())
Expand All @@ -145,7 +145,7 @@ impl TryFrom<Value> for String {
type Error = NotA<String>;

fn try_from(v: Value) -> Result<Self, NotA<String>> {
if let Some(Kind::StringValue(t)) = v.kind {
if let Some(StringValue(t)) = v.kind {
Ok(t)
} else {
Err(NotA::default())
Expand Down
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ pub mod serde;

use error::NotA;
use qdrant::{value::Kind::*, ListValue, RetrievedPoint, ScoredPoint, Struct, Value};
use std::error::Error;
use std::fmt::{Debug, Display, Formatter};
use std::fmt::{Display, Formatter};
use std::hash::{Hash, Hasher};

#[doc(no_inline)]
Expand Down Expand Up @@ -152,8 +151,8 @@ impl ScoredPoint {
///
/// # Examples:
/// ```
/// use qdrant_client::qdrant::ScrollPoints;
/// let point = ScrollPoints::default();
/// use qdrant_client::qdrant::ScoredPoint;
/// let point = ScoredPoint::default();
/// assert!(point.get("not_present").is_null());
/// ````
pub fn get(&self, key: &str) -> &Value {
Expand Down

0 comments on commit 4e0a8e4

Please sign in to comment.