Remove legacy

This commit is contained in:
Dominik Werder
2022-12-13 12:59:02 +01:00
parent dd8d85d5ef
commit 3016da236b
8 changed files with 19 additions and 150 deletions

View File

@@ -120,7 +120,7 @@ pub async fn table_sizes(node_config: &NodeConfigCached) -> Result<TableSizes, E
let sql = sql.as_str();
let cl = create_connection(&node_config.node_config.cluster.database).await?;
let rows = cl.query(sql, &[]).await.err_conv()?;
let mut sizes = TableSizes { sizes: vec![] };
let mut sizes = TableSizes { sizes: Vec::new() };
sizes.sizes.push((format!("table"), format!("size")));
for row in rows {
sizes.sizes.push((row.get(0), row.get(1)));

View File

@@ -208,7 +208,7 @@ impl UpdatedDbWithChannelNamesStream {
find: None,
update_batch: None,
channel_inp_done: false,
clist: vec![],
clist: Vec::new(),
};
ret.client_fut = Some(Box::pin(create_connection(
&ret.node_config_ref.node_config.cluster.database,
@@ -243,7 +243,7 @@ impl Stream for UpdatedDbWithChannelNamesStream {
Ready(None) => {
*pself.channel_inp_done = true;
// Work through the collected items
let l = std::mem::replace(pself.clist, vec![]);
let l = std::mem::replace(pself.clist, Vec::new());
let fut = update_db_with_channel_name_list(
l,
pself.ident.as_ref().unwrap().facility,

View File

@@ -26,7 +26,7 @@ pub async fn search_channel_databuffer(
true
};
if empty {
let ret = ChannelSearchResult { channels: vec![] };
let ret = ChannelSearchResult { channels: Vec::new() };
return Ok(ret);
}
let sql = format!(concat!(
@@ -42,14 +42,14 @@ pub async fn search_channel_databuffer(
)
.await
.err_conv()?;
let mut res = vec![];
let mut res = Vec::new();
for row in rows {
let shapedb: Option<serde_json::Value> = row.get(4);
let shape = match &shapedb {
Some(top) => match top {
serde_json::Value::Null => vec![],
serde_json::Value::Null => Vec::new(),
serde_json::Value::Array(items) => {
let mut a = vec![];
let mut a = Vec::new();
for item in items {
match item {
serde_json::Value::Number(n) => match n.as_i64() {
@@ -65,7 +65,7 @@ pub async fn search_channel_databuffer(
}
_ => return Err(Error::with_msg(format!("can not understand shape {:?}", shapedb))),
},
None => vec![],
None => Vec::new(),
};
let ty: String = row.get(3);
let k = ChannelSearchSingleResult {
@@ -149,7 +149,7 @@ pub async fn search_channel_archeng(
false
};
if empty {
let ret = ChannelSearchResult { channels: vec![] };
let ret = ChannelSearchResult { channels: Vec::new() };
return Ok(ret);
}
let sql = format!(concat!(
@@ -161,7 +161,7 @@ pub async fn search_channel_archeng(
));
let cl = create_connection(database).await?;
let rows = cl.query(sql.as_str(), &[&query.name_regex]).await.err_conv()?;
let mut res = vec![];
let mut res = Vec::new();
for row in rows {
let name: String = row.get(0);
let config: JsVal = row.get(1);
@@ -189,7 +189,7 @@ pub async fn search_channel_archeng(
Some(k) => match k {
JsVal::String(k) => {
if k == "Scalar" {
vec![]
Vec::new()
} else {
return Err(Error::with_msg_no_trace(format!(
"search_channel_archeng can not understand {:?}",
@@ -223,7 +223,7 @@ pub async fn search_channel_archeng(
)));
}
},
None => vec![],
None => Vec::new(),
};
let k = ChannelSearchSingleResult {
backend: backend.clone(),