Skip to content

Commit

Permalink
Fix formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
YoEight committed Dec 27, 2024
1 parent 1b74740 commit fc3b597
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/appending_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#![allow(unused_results)]
#![allow(unused_variables)]

use futures::TryStreamExt;
use kurrent::{
AppendToStreamOptions, Client, Credentials, EventData, ExpectedRevision, ReadStreamOptions,
StreamPosition,
};
use futures::TryStreamExt;
use serde::{Deserialize, Serialize};
use std::error::Error;
use uuid::Uuid;
Expand Down
2 changes: 1 addition & 1 deletion examples/server_side_filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#![allow(unused_variables)]
#![allow(unreachable_code)]

use futures::TryStreamExt;
use kurrent::{
Client, Credentials, EventData, ExpectedRevision, SubscribeToAllOptions, SubscriptionEvent,
SubscriptionFilter,
};
use futures::TryStreamExt;
use serde::{Deserialize, Serialize};
use std::error::Error;
use uuid::Uuid;
Expand Down
2 changes: 1 addition & 1 deletion examples/subscribing_to_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#![allow(unused_variables)]
#![allow(unreachable_code)]

use futures::TryStreamExt;
use kurrent::{
Client, Credentials, EventData, ExpectedRevision, Position, RetryOptions, StreamPosition,
SubscribeToAllOptions, SubscribeToStreamOptions, SubscriptionEvent, SubscriptionFilter,
};
use futures::TryStreamExt;
use serde::{Deserialize, Serialize};
use std::error::Error;
use uuid::Uuid;
Expand Down
5 changes: 4 additions & 1 deletion kurrent/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,10 @@ impl GrpcClient {

pub(crate) fn handle_error(sender: &UnboundedSender<Msg>, connection_id: Uuid, err: &crate::Error) {
if let crate::Error::ServerError(ref status) = err {
error!("Current selected KurrentDB node gone unavailable. Starting node selection process: {}", status);
error!(
"Current selected KurrentDB node gone unavailable. Starting node selection process: {}",
status
);

let _ = sender.send(Msg::CreateChannel(connection_id, None));
} else if let crate::Error::NotLeaderException(ref leader) = err {
Expand Down
16 changes: 6 additions & 10 deletions kurrent/tests/api/streams.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::common::{fresh_stream_id, generate_events};
use chrono::{Datelike, Utc};
use futures::channel::oneshot;
use kurrent::{
Acl, Client, ReadEvent, StreamAclBuilder, StreamMetadataBuilder, StreamMetadataResult,
StreamName, StreamPosition, SubscriptionEvent,
};
use futures::channel::oneshot;
use std::collections::HashMap;
use std::time::Duration;

Expand Down Expand Up @@ -258,8 +258,8 @@ async fn test_subscription(client: &Client) -> eyre::Result<()> {
.append_to_stream(stream_id.as_str(), &Default::default(), events_before)
.await?;

let options = kurrent::SubscribeToStreamOptions::default()
.start_from(kurrent::StreamPosition::Start);
let options =
kurrent::SubscribeToStreamOptions::default().start_from(kurrent::StreamPosition::Start);

let mut sub = client
.subscribe_to_stream(stream_id.as_str(), &options)
Expand Down Expand Up @@ -321,8 +321,8 @@ async fn test_subscription_caughtup(client: &Client) -> kurrent::Result<()> {
.append_to_stream(stream_id.clone(), &Default::default(), events)
.await?;

let options = kurrent::SubscribeToStreamOptions::default()
.start_from(kurrent::StreamPosition::Start);
let options =
kurrent::SubscribeToStreamOptions::default().start_from(kurrent::StreamPosition::Start);

let mut sub = client
.subscribe_to_stream(stream_id.clone(), &options)
Expand Down Expand Up @@ -382,11 +382,7 @@ async fn test_batch_append(client: &Client) -> kurrent::Result<()> {
let stream_id = fresh_stream_id("batch-append");
let events = generate_events("batch-append-type", 3);
let _ = batch_client
.append_to_stream(
stream_id.as_str(),
kurrent::ExpectedRevision::Any,
events,
)
.append_to_stream(stream_id.as_str(), kurrent::ExpectedRevision::Any, events)
.await?;
let options = kurrent::ReadStreamOptions::default()
.forwards()
Expand Down
2 changes: 1 addition & 1 deletion kurrent/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ mod common;
mod images;

use crate::common::{fresh_stream_id, generate_events};
use kurrent::{Client, ClientSettings};
use futures::channel::oneshot;
use kurrent::{Client, ClientSettings};
use std::time::Duration;
use testcontainers::clients::Cli;
use testcontainers::core::RunnableImage;
Expand Down

0 comments on commit fc3b597

Please sign in to comment.