Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 1ac9946

Browse files
authored
Merge pull request #2442 from suchapalaver/update-edition-to-rust-2021
Update edition to rust 2021
2 parents 714486e + 9387750 commit 1ac9946

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+324
-321
lines changed

adm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ name = "sawtooth-sawadm"
1818
version = "0.1.0"
1919
authors = ["sawtooth"]
2020
description = "The sawadm command is used for Sawtooth administration tasks."
21+
edition = '2021'
2122

2223
[[bin]]
2324
name = "sawadm"

adm/src/blockstore.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
* ------------------------------------------------------------------------------
1616
*/
1717

18-
use proto::block::{Block, BlockHeader};
18+
use crate::proto::block::{Block, BlockHeader};
1919
use protobuf::Message;
2020

21-
use database::error::DatabaseError;
22-
use database::lmdb::LmdbDatabase;
21+
use crate::database::error::DatabaseError;
22+
use crate::database::lmdb::LmdbDatabase;
2323

2424
pub struct Blockstore<'a> {
2525
db: LmdbDatabase<'a>,
@@ -207,10 +207,10 @@ impl<'a> Blockstore<'a> {
207207
#[cfg(test)]
208208
mod tests {
209209
use super::*;
210-
use config;
211-
use database::lmdb::LmdbContext;
212-
use proto::batch::{Batch, BatchHeader};
213-
use proto::transaction::Transaction;
210+
use crate::config;
211+
use crate::database::lmdb::LmdbContext;
212+
use crate::proto::batch::{Batch, BatchHeader};
213+
use crate::proto::transaction::Transaction;
214214

215215
/// Asserts that BLOCKSTORE has a current height of COUNT.
216216
fn assert_current_height(count: usize, blockstore: &Blockstore) {

adm/src/commands/blockstore.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ use protobuf;
2424
use protobuf::Message;
2525
use serde_yaml;
2626

27-
use proto::block::{Block, BlockHeader};
28-
use proto::transaction::TransactionHeader;
29-
30-
use blockstore::Blockstore;
31-
use config;
32-
use database::error::DatabaseError;
33-
use database::lmdb;
34-
use err::CliError;
35-
use wrappers::Block as BlockWrapper;
27+
use crate::proto::block::{Block, BlockHeader};
28+
use crate::proto::transaction::TransactionHeader;
29+
30+
use crate::blockstore::Blockstore;
31+
use crate::config;
32+
use crate::database::error::DatabaseError;
33+
use crate::database::lmdb;
34+
use crate::err::CliError;
35+
use crate::wrappers::Block as BlockWrapper;
3636

3737
const NULL_BLOCK_IDENTIFIER: &str = "0000000000000000";
3838

adm/src/commands/genesis.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ use clap::ArgMatches;
2424
use protobuf;
2525
use protobuf::Message;
2626

27-
use proto::batch::{Batch, BatchList};
28-
use proto::genesis::GenesisData;
29-
use proto::settings::{SettingProposal, SettingsPayload, SettingsPayload_Action};
30-
use proto::transaction::TransactionHeader;
27+
use crate::proto::batch::{Batch, BatchList};
28+
use crate::proto::genesis::GenesisData;
29+
use crate::proto::settings::{SettingProposal, SettingsPayload, SettingsPayload_Action};
30+
use crate::proto::transaction::TransactionHeader;
3131

32-
use config;
33-
use err::CliError;
32+
use crate::config;
33+
use crate::err::CliError;
3434

3535
pub fn run(args: &ArgMatches) -> Result<(), CliError> {
3636
let genesis_file_path = if args.is_present("output") {
@@ -177,8 +177,8 @@ mod tests {
177177

178178
use protobuf::RepeatedField;
179179

180-
use proto::batch::BatchHeader;
181-
use proto::transaction::Transaction;
180+
use crate::proto::batch::BatchHeader;
181+
use crate::proto::transaction::Transaction;
182182

183183
fn get_required_settings_batch() -> Batch {
184184
let required_settings = vec![

adm/src/commands/keygen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ use libc;
3030

3131
use sawtooth_sdk::signing;
3232

33-
use config;
34-
use err::CliError;
33+
use crate::config;
34+
use crate::err::CliError;
3535

3636
pub fn run(args: &ArgMatches) -> Result<(), CliError> {
3737
let path_config = config::get_path_config();

adm/src/database/lmdb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::path::Path;
2020

2121
use lmdb_zero as lmdb;
2222

23-
use database::error::DatabaseError;
23+
use crate::database::error::DatabaseError;
2424

2525
const DEFAULT_SIZE: usize = 1 << 40; // 1024 ** 4
2626

@@ -234,7 +234,7 @@ impl<'a> LmdbDatabaseWriter<'a> {
234234
#[cfg(test)]
235235
mod tests {
236236
use super::*;
237-
use config;
237+
use crate::config;
238238

239239
/// Asserts that there are COUNT many objects in DB.
240240
fn assert_database_count(count: usize, db: &LmdbDatabase) {

adm/src/err.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* ------------------------------------------------------------------------------
1616
*/
1717

18-
use std;
19-
2018
#[allow(clippy::enum_variant_names)]
2119
#[derive(Debug)]
2220
pub enum CliError {

adm/src/wrappers.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
* limitations under the License.
1515
* ------------------------------------------------------------------------------
1616
*/
17-
use std;
18-
1917
use protobuf::Message;
2018

21-
use proto;
19+
use crate::proto;
2220

2321
#[derive(Debug)]
2422
pub enum Error {

families/battleship/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
name = "battleship"
1717
version = "0.1.0"
1818
authors = ["Bitwise IO, Inc."]
19+
edition = '2021'
1920

2021
[[example]]
2122
name = "play"

families/battleship/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use crate::game::{Action, Game};
16+
use crate::transaction_builder::TransactionBuilder;
1517
use base64::{engine::general_purpose, Engine as _};
1618
use dirs::home_dir;
1719
use failure::Error;
18-
use game::{Action, Game};
1920
use reqwest::{Client, Url};
2021
use sawtooth_sdk::signing::secp256k1::Secp256k1PrivateKey;
2122
use sawtooth_sdk::signing::{create_context, PrivateKey, Signer};
@@ -26,7 +27,6 @@ use std::io::Read;
2627
use std::path::PathBuf;
2728
use std::thread::sleep;
2829
use std::time::Duration;
29-
use transaction_builder::TransactionBuilder;
3030

3131
#[allow(clippy::upper_case_acronyms)]
3232
#[derive(Deserialize, Debug)]

0 commit comments

Comments
 (0)