Skip to content

Commit

Permalink
Upgrade rust toolchains
Browse files Browse the repository at this point in the history
Currently, Foundry uses the clippy(+nightly-2019-11-06) and the rustfmt(+nightly-2019-11-06).
We need to make codechain use the latest toolchains.
I upgraded the clippy to `+nightly-2019-12-19` and the rustfmt to `+nigtly-2019-12-19`.
  • Loading branch information
SeungMin Lee authored and majecty committed Jan 13, 2020
1 parent cb9ad6e commit e13c363
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cargo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2019-11-06
toolchain: nightly-2019-12-19
components: clippy
profile: minimal
override: true
Expand All @@ -28,7 +28,7 @@ jobs:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2019-11-06
toolchain: nightly-2019-12-19
components: rustfmt
profile: minimal
override: true
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,35 +73,35 @@ You can create a block by sending a transaction through [JSON-RPC](https://githu
## Formatting
Make sure you run `rustfmt` before creating a PR to the repo. You need to install the nightly-2019-11-06 version of `rustfmt`.
Make sure you run `rustfmt` before creating a PR to the repo. You need to install the nightly-2019-12-19 version of `rustfmt`.
```sh
rustup toolchain install nightly-2019-11-06
rustup component add rustfmt --toolchain nightly-2019-11-06
rustup toolchain install nightly-2019-12-19
rustup component add rustfmt --toolchain nightly-2019-12-19
```
To run `rustfmt`,
```sh
cargo +nightly-2019-11-06 fmt
cargo +nightly-2019-12-19 fmt
```
## Linting
You should run `clippy` also. This is a lint tool for rust. It suggests more efficient/readable code.
You can see [the clippy document](https://rust-lang.github.io/rust-clippy/master/index.html) for more information.
You need to install the nightly-2019-11-06 version of `clippy`.
You need to install the nightly-2019-12-19 version of `clippy`.
### Install
```sh
rustup toolchain install nightly-2019-11-06
rustup component add clippy --toolchain nightly-2019-11-06
rustup toolchain install nightly-2019-12-19
rustup component add clippy --toolchain nightly-2019-12-19
```
### Run
```sh
cargo +nightly-2019-11-06 clippy --all --all-targets
cargo +nightly-2019-12-19 clippy --all --all-targets
```
## Testing
Expand Down
36 changes: 18 additions & 18 deletions util/io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@
//! struct MyHandler;
//!
//! struct MyMessage {
//! data: u32
//! data: u32
//! }
//!
//! impl IoHandler<MyMessage> for MyHandler {
//! fn initialize(&self, io: &IoContext<MyMessage>) -> IoHandlerResult<()> {
//! io.register_timer(0, Duration::from_secs(1));
//! Ok(())
//! }
//! fn initialize(&self, io: &IoContext<MyMessage>) -> IoHandlerResult<()> {
//! io.register_timer(0, Duration::from_secs(1));
//! Ok(())
//! }
//!
//! fn timeout(&self, _io: &IoContext<MyMessage>, timer: TimerToken) -> IoHandlerResult<()> {
//! println!("Timeout {}", timer);
//! Ok(())
//! }
//! fn timeout(&self, _io: &IoContext<MyMessage>, timer: TimerToken) -> IoHandlerResult<()> {
//! println!("Timeout {}", timer);
//! Ok(())
//! }
//!
//! fn message(&self, _io: &IoContext<MyMessage>, message: MyMessage) -> IoHandlerResult<()> {
//! println!("Message {}", message.data);
//! Ok(())
//! }
//! fn message(&self, _io: &IoContext<MyMessage>, message: MyMessage) -> IoHandlerResult<()> {
//! println!("Message {}", message.data);
//! Ok(())
//! }
//! }
//!
//! fn main () {
//! let mut service = IoService::<MyMessage>::start("Test").expect("Error creating network service");
//! service.register_handler(Arc::new(MyHandler)).unwrap();
//! let mut service = IoService::<MyMessage>::start("Test").expect("Error creating network service");
//! service.register_handler(Arc::new(MyHandler)).unwrap();
//!
//! // Wait for quit condition
//! // ...
//! // Drop the service
//! // Wait for quit condition
//! // ...
//! // Drop the service
//! }
//! ```

Expand Down

0 comments on commit e13c363

Please sign in to comment.