chore: upgrade rust toolchain to latest nightly (#2049)

* chore: upgrade rust toolchain to latest nightly

* rebase develop

* update rust toolchain in ci
This commit is contained in:
LFC
2023-08-08 15:17:51 +08:00
committed by GitHub
parent 7d0d8dc6e3
commit 46fa3eb629
127 changed files with 551 additions and 339 deletions

View File

@@ -123,7 +123,8 @@ impl DatanodeTableManager {
let Some(curr) = resp
.prev_kv
.map(|kv| DatanodeTableValue::try_from_raw_value(kv.value))
.transpose()? else {
.transpose()?
else {
return UnexpectedSnafu {
err_msg: format!("compare_and_put expect None but failed with current value None, key: {key}, val: {val:?}"),
}.fail();

View File

@@ -81,7 +81,7 @@ impl TableInfoManager {
let Some(curr) = curr else {
return UnexpectedSnafu {
err_msg: format!("compare_and_put expect None but failed with current value None, table_id: {table_id}, table_info: {table_info:?}"),
}.fail()
}.fail();
};
ensure!(
&curr.table_info == table_info,

View File

@@ -163,10 +163,11 @@ impl TableNameManager {
let Some(curr) = result
.prev_kv
.map(|x| TableNameValue::try_from_raw_value(x.value))
.transpose()? else {
.transpose()?
else {
return UnexpectedSnafu {
err_msg: format!("compare_and_put expect None but failed with current value None, key: {key}, value: {value:?}"),
}.fail()
}.fail();
};
ensure!(
curr.table_id == table_id,
@@ -226,7 +227,8 @@ impl TableNameManager {
// name, then the table must not exist at the first place.
return TableNotExistSnafu {
table_name: TableName::from(key).to_string(),
}.fail();
}
.fail();
};
ensure!(

View File

@@ -91,7 +91,7 @@ impl TableRegionManager {
let Some(curr) = curr else {
return UnexpectedSnafu {
err_msg: format!("compare_and_put expect None but failed with current value None, table_id: {table_id}, region_distribution: {region_distribution:?}"),
}.fail()
}.fail();
};
ensure!(
&curr.region_distribution == region_distribution,

View File

@@ -236,7 +236,7 @@ impl<T: ErrorExt + Send + Sync + 'static> KvBackend for MemoryKvBackend<T> {
start: key,
end: range_end,
};
kvs.drain_filter(|key, _| range.contains(key))
kvs.extract_if(|key, _| range.contains(key))
.map(Into::into)
.collect::<Vec<_>>()
};

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#![feature(btree_drain_filter)]
#![feature(btree_extract_if)]
pub mod error;
pub mod heartbeat;