Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
  • Loading branch information
BugenZhao committed Nov 1, 2022
1 parent 00804d2 commit 9a4495f
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/common/src/array/stream_chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl StreamChunk {
None => "".to_owned(), // NULL
Some(scalar) => scalar.to_string(),
};
cells.push(Cell::new(&str));
cells.push(Cell::new(str));
}
table.add_row(cells);
}
Expand Down
4 changes: 2 additions & 2 deletions src/connector/src/source/filesystem/s3/s3_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ pub async fn new_share_config(
secret_access,
session_token,
} => SharedCredentialsProvider::new(aws_types::Credentials::from_keys(
&access_key,
&secret_access,
access_key,
secret_access,
session_token,
)),
};
Expand Down
2 changes: 1 addition & 1 deletion src/risedevtool/src/bin/risedev-dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ fn main() -> Result<()> {

std::fs::write(
Path::new(&env::var("PREFIX_CONFIG")?).join("risectl-env"),
&risectl_env,
risectl_env,
)?;

println!("All services started successfully.");
Expand Down
6 changes: 3 additions & 3 deletions src/risedevtool/src/compose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,17 @@ impl Compose for GrafanaConfig {
let config_root = Path::new(&config.config_directory);
std::fs::write(
config_root.join("grafana.ini"),
&GrafanaGen.gen_custom_ini(self),
GrafanaGen.gen_custom_ini(self),
)?;

std::fs::write(
config_root.join("grafana-risedev-datasource.yml"),
&GrafanaGen.gen_datasource_yml(self)?,
GrafanaGen.gen_datasource_yml(self)?,
)?;

std::fs::write(
config_root.join("grafana-risedev-dashboard.yml"),
&GrafanaGen.gen_dashboard_yml(self, config_root, "/")?,
GrafanaGen.gen_dashboard_yml(self, config_root, "/")?,
)?;

let service = ComposeService {
Expand Down
2 changes: 1 addition & 1 deletion src/risedevtool/src/compose_deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ fi
x
};
let deploy_sh = Path::new(output_directory).join("deploy.sh");
fs::write(&deploy_sh, &shell_script)?;
fs::write(&deploy_sh, shell_script)?;
let mut perms = fs::metadata(&deploy_sh)?.permissions();
perms.set_mode(perms.mode() | 0o755);
fs::set_permissions(&deploy_sh, perms)?;
Expand Down
6 changes: 3 additions & 3 deletions src/risedevtool/src/task/grafana_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ impl GrafanaService {

std::fs::write(
config_root.join("custom.ini"),
&GrafanaGen.gen_custom_ini(config),
GrafanaGen.gen_custom_ini(config),
)?;

let config_datasources_dir = config_root.join("provisioning").join("datasources");
std::fs::remove_dir_all(&config_datasources_dir)?;
std::fs::create_dir_all(&config_datasources_dir)?;
std::fs::write(
config_datasources_dir.join("risedev-prometheus.yml"),
&GrafanaGen.gen_datasource_yml(config)?,
GrafanaGen.gen_datasource_yml(config)?,
)?;

let prefix_config = prefix_config.as_ref();
Expand All @@ -76,7 +76,7 @@ impl GrafanaService {
std::fs::create_dir_all(&config_dashboards_dir)?;
std::fs::write(
config_dashboards_dir.join("risingwave-dashboard.yaml"),
&GrafanaGen.gen_dashboard_yml(config, prefix_config, prefix_config)?,
GrafanaGen.gen_dashboard_yml(config, prefix_config, prefix_config)?,
)?;
// std::fs::write(
// config_dashboards_dir.join("aws-s3-dashboards.yaml"),
Expand Down
2 changes: 1 addition & 1 deletion src/risedevtool/src/task/kafka_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Task for KafkaService {
let config_path = Path::new(&prefix_config).join(format!("{}.properties", self.id()));
std::fs::write(
&config_path,
&KafkaGen.gen_server_properties(&self.config, &path.to_string_lossy()),
KafkaGen.gen_server_properties(&self.config, &path.to_string_lossy()),
)?;

let mut cmd = self.kafka()?;
Expand Down
2 changes: 1 addition & 1 deletion src/risedevtool/src/task/prometheus_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Task for PrometheusService {

std::fs::write(
Path::new(&prefix_config).join("prometheus.yml"),
&PrometheusGen.gen_prometheus_yml(&self.config),
PrometheusGen.gen_prometheus_yml(&self.config),
)?;

let mut cmd = self.prometheus()?;
Expand Down
2 changes: 1 addition & 1 deletion src/risedevtool/src/task/zookeeper_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Task for ZooKeeperService {
let config_path = Path::new(&prefix_config).join(format!("{}.properties", self.id()));
std::fs::write(
&config_path,
&ZooKeeperGen.gen_server_properties(&self.config, &path.to_string_lossy()),
ZooKeeperGen.gen_server_properties(&self.config, &path.to_string_lossy()),
)?;

let mut cmd = self.zookeeper()?;
Expand Down
2 changes: 1 addition & 1 deletion src/source/src/parser/pb_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ mod test {
let dir = PathBuf::from("src/test_data");
format!(
"file://{}",
std::fs::canonicalize(&dir).unwrap().to_str().unwrap()
std::fs::canonicalize(dir).unwrap().to_str().unwrap()
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/storage/src/hummock/iterator/merge_inner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ trait MergeIteratorNext {
}

impl<I: HummockIterator> MergeIteratorNext for OrderedMergeIteratorInner<I> {
type HummockResultFuture<'a> = impl Future<Output = HummockResult<()>>;
type HummockResultFuture<'a> = impl Future<Output = HummockResult<()>> + 'a;

fn next_inner(&mut self) -> Self::HummockResultFuture<'_> {
async {
Expand Down Expand Up @@ -248,7 +248,7 @@ impl<I: HummockIterator> MergeIteratorNext for OrderedMergeIteratorInner<I> {
}

impl<I: HummockIterator> MergeIteratorNext for UnorderedMergeIteratorInner<I> {
type HummockResultFuture<'a> = impl Future<Output = HummockResult<()>>;
type HummockResultFuture<'a> = impl Future<Output = HummockResult<()>> + 'a;

fn next_inner(&mut self) -> Self::HummockResultFuture<'_> {
async {
Expand Down
1 change: 0 additions & 1 deletion src/stream/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#![feature(generators)]
#![feature(proc_macro_hygiene)]
#![feature(stmt_expr_attributes)]
#![feature(unzip_option)]
#![feature(allocator_api)]
#![feature(map_try_insert)]
#![feature(result_option_inspect)]
Expand Down

0 comments on commit 9a4495f

Please sign in to comment.