Skip to content

Commit

Permalink
fix format and clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Feb 7, 2024
1 parent f57e7c4 commit 8e971ef
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/connector/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ macro_rules! impl_split {

$(
impl TryFrom<SplitImpl> for $split {
type Error = crate::error::ConnectorError;
type Error = $crate::error::ConnectorError;

fn try_from(split: SplitImpl) -> std::result::Result<Self, Self::Error> {
match split {
Expand Down
1 change: 0 additions & 1 deletion src/connector/src/sink/log_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use std::future::{poll_fn, Future};
use std::sync::Arc;
use std::task::Poll;

use anyhow::anyhow;
use futures::{TryFuture, TryFutureExt};
use risingwave_common::array::StreamChunk;
use risingwave_common::bail;
Expand Down
4 changes: 2 additions & 2 deletions src/connector/src/source/cdc/source/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use risingwave_pb::connector_service::{
use thiserror_ext::AsReport;
use tokio::sync::mpsc;

use crate::error::{ConnectorError, ConnectorResult as Result};
use crate::error::{ConnectorError, ConnectorResult};
use crate::parser::ParserConfig;
use crate::source::base::SourceMessage;
use crate::source::cdc::{CdcProperties, CdcSourceType, CdcSourceTypeTrait, DebeziumCdcSplit};
Expand Down Expand Up @@ -68,7 +68,7 @@ impl<T: CdcSourceTypeTrait> SplitReader for CdcSplitReader<T> {
parser_config: ParserConfig,
source_ctx: SourceContextRef,
_columns: Option<Vec<Column>>,
) -> Result<Self> {
) -> ConnectorResult<Self> {
assert_eq!(splits.len(), 1);
let split = splits.into_iter().next().unwrap();
let split_id = split.id();
Expand Down
2 changes: 1 addition & 1 deletion src/connector/src/source/cdc/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use std::marker::PhantomData;

use anyhow::{anyhow, Context};
use anyhow::Context;
use risingwave_common::types::JsonbVal;
use serde::{Deserialize, Serialize};

Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/datagen/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use risingwave_common::types::JsonbVal;
use serde::{Deserialize, Serialize};

Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/filesystem/file_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use std::fmt::Debug;
use std::hash::Hash;
use std::marker::PhantomData;

use anyhow::anyhow;
use aws_sdk_s3::types::Object;
use risingwave_common::types::{JsonbVal, Timestamptz};
use serde::{Deserialize, Serialize};
Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/filesystem/nd_streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use bytes::BytesMut;
use futures::io::Cursor;
use futures::AsyncBufReadExt;
Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/google_pubsub/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use risingwave_common::types::JsonbVal;
use serde::{Deserialize, Serialize};

Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/kafka/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use risingwave_common::types::JsonbVal;
use serde::{Deserialize, Serialize};

Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/kinesis/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use risingwave_common::types::JsonbVal;
use serde::{Deserialize, Serialize};

Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/nats/source/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use async_nats::jetstream::consumer;
use async_trait::async_trait;
use futures::StreamExt;
Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/nexmark/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use risingwave_common::types::JsonbVal;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion src/connector/src/source/pulsar/enumerator/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl SplitEnumerator for PulsarSplitEnumerator {
async fn new(
properties: PulsarProperties,
_context: SourceEnumeratorContextRef,
) -> Result<PulsarSplitEnumerator> {
) -> ConnectorResult<PulsarSplitEnumerator> {
let pulsar = properties
.common
.build_client(&properties.oauth, &properties.aws_auth_props)
Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/pulsar/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use anyhow::anyhow;
use risingwave_common::types::JsonbVal;
use serde::{Deserialize, Serialize};

Expand Down
1 change: 0 additions & 1 deletion src/connector/src/source/test_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use std::collections::HashMap;
use std::sync::{Arc, OnceLock};

use anyhow::anyhow;
use async_trait::async_trait;
use parking_lot::Mutex;
use risingwave_common::bail;
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/controller/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ impl CatalogController {
let ret = src_manager.register_source(&pb_source).await;
if let Err(e) = ret {
txn.rollback().await?;
return Err(e.into());
return Err(e);
}
}
txn.commit().await?;
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/rpc/ddl_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ impl DdlController {
mgr.catalog_manager
.cancel_create_source_procedure(&source)
.await?;
return Err(e.into());
return Err(e);
}

mgr.catalog_manager
Expand Down

0 comments on commit 8e971ef

Please sign in to comment.