Skip to content

Commit 588e3df

Browse files
committed
feat: add a generic parameter to error::Result<T, E=Error> (with default value)
1 parent 7ab0756 commit 588e3df

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
### Added
66
- `network::client::tcp::TcpStream` not supports async connection, provided with `connect_async` and `connect_timeout_async` methods
77

8-
### Fixes
8+
### Changed
9+
- `error::Result` type alias now has another generic parameter E, which defaults
10+
to `tarantool::error::Error`, but allows this type alias to be used as a drop
11+
in replacement from `std::result::Result`.
12+
13+
### Fixed
914
- `network::client::tcp::TcpStream` does not close underlying fd anymore. Now fd will be closed only when the last copy of tcp stream is dropped.
1015

1116
### Deprecated

tarantool/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::transaction::TransactionError;
3333
use crate::util::to_cstring_lossy;
3434

3535
/// A specialized [`Result`] type for the crate
36-
pub type Result<T> = std::result::Result<T, Error>;
36+
pub type Result<T, E = Error> = std::result::Result<T, E>;
3737

3838
pub type TimeoutError<E> = crate::fiber::r#async::timeout::Error<E>;
3939

0 commit comments

Comments
 (0)