Skip to content

Commit 495be1f

Browse files
committed
Use SkyResult for all Result returns
1 parent 473e181 commit 495be1f

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/aio.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use crate::deserializer::{ParseError, Parser, RawResponse};
2828
use crate::error::SkyhashError;
2929
use crate::types::FromSkyhashBytes;
3030
use crate::Element;
31-
use crate::IoResult;
3231
use crate::Pipeline;
3332
use crate::Query;
3433
use crate::SkyQueryResult;
@@ -137,7 +136,7 @@ cfg_async!(
137136

138137
impl Connection {
139138
/// Create a new connection to a Skytable instance hosted on `host` and running on `port`
140-
pub async fn new(host: &str, port: u16) -> IoResult<Self> {
139+
pub async fn new(host: &str, port: u16) -> SkyResult<Self> {
141140
let stream = TcpStream::connect((host, port)).await?;
142141
Ok(Connection {
143142
stream: BufWriter::new(stream),

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
//! imports:
4545
//!
4646
//! ```no_run
47-
//! use skytable::{Connection, Query, Element};
48-
//! fn main() -> std::io::Result<()> {
47+
//! use skytable::{Connection, Query, Element, SkyResult};
48+
//! fn main() -> SkyResult<()> {
4949
//! let mut con = Connection::new("127.0.0.1", 2003)?;
5050
//! Ok(())
5151
//! }

src/pool.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//! a worker receives a task is slow while maintaining a connection per worker might be cumbersome
2323
//! to implement.
2424
//!
25-
//! To provide connection pooling, we use [`r2d2`] for a sync connection pool while we use
25+
//! To provide connection pooling, we use [`r2d2`](https://docs.rs/r2d2) for a sync connection pool while we use
2626
//! [`bb8`](https://docs.rs/bb8) to provide an async connection pool.
2727
//!
2828
//! ## Basic usage
@@ -122,6 +122,9 @@
122122
//!```
123123
//!
124124
125+
/// The default connection pool size
126+
pub const DEFAULT_POOL_SIZE: usize = 10;
127+
125128
// re-exports
126129
// sync
127130
cfg_sync! {

src/sync.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use crate::deserializer::{ParseError, Parser, RawResponse};
2828
use crate::error::SkyhashError;
2929
use crate::types::FromSkyhashBytes;
3030
use crate::Element;
31-
use crate::IoResult;
3231
use crate::Pipeline;
3332
use crate::Query;
3433
use crate::SkyQueryResult;
@@ -140,7 +139,7 @@ cfg_sync!(
140139

141140
impl Connection {
142141
/// Create a new connection to a Skytable instance hosted on `host` and running on `port`
143-
pub fn new(host: &str, port: u16) -> IoResult<Self> {
142+
pub fn new(host: &str, port: u16) -> SkyResult<Self> {
144143
let stream = TcpStream::connect((host, port))?;
145144
Ok(Connection {
146145
stream,

0 commit comments

Comments
 (0)