Skip to content

Commit 2e98c68

Browse files
committed
update benchmark crate to 2018 edition
1 parent 8ccee11 commit 2e98c68

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

benchmark/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name = "benchmark"
44
version = "0.0.0"
55
authors = [ "David Renshaw <[email protected]>" ]
66
build = "build.rs"
7+
edition = "2018"
78

89
[[bin]]
910

benchmark/benchmark.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2020
// THE SOFTWARE.
2121

22-
extern crate capnp;
23-
2422
use std::{mem, io};
2523

2624
use capnp::{message, serialize, serialize_packed};
@@ -49,10 +47,10 @@ trait TestCase {
4947
type Response: for<'a> Owned<'a>;
5048
type Expectation;
5149

52-
fn setup_request(&self, &mut common::FastRand, <Self::Request as Owned>::Builder) -> Self::Expectation;
53-
fn handle_request(&self, <Self::Request as Owned>::Reader, <Self::Response as Owned>::Builder)
50+
fn setup_request(&self, rnd: &mut crate::common::FastRand, b: <Self::Request as Owned>::Builder) -> Self::Expectation;
51+
fn handle_request(&self, r: <Self::Request as Owned>::Reader, b: <Self::Response as Owned>::Builder)
5452
-> ::capnp::Result<()>;
55-
fn check_response(&self, <Self::Response as Owned>::Reader, Self::Expectation) -> ::capnp::Result<()>;
53+
fn check_response(&self, r: <Self::Response as Owned>::Reader, e: Self::Expectation) -> ::capnp::Result<()>;
5654
}
5755

5856
trait Serialize {

benchmark/carsales.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2020
// THE SOFTWARE.
2121

22-
use common::*;
23-
use carsales_capnp::{parking_lot, total_value, Color, car};
22+
use crate::common::*;
23+
use crate::carsales_capnp::{parking_lot, total_value, Color, car};
2424

2525
trait CarValue {
2626
fn car_value(self) -> ::capnp::Result<u64>;
@@ -128,7 +128,7 @@ pub fn random_car(rng: &mut FastRand, mut car: car::Builder) {
128128

129129
pub struct CarSales;
130130

131-
impl ::TestCase for CarSales {
131+
impl crate::TestCase for CarSales {
132132
type Request = parking_lot::Owned;
133133
type Response = total_value::Owned;
134134
type Expectation = u64;

benchmark/catrank.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2020
// THE SOFTWARE.
2121

22-
use common::*;
23-
use catrank_capnp::*;
22+
use crate::common::*;
23+
use crate::catrank_capnp::*;
2424

2525
#[derive(Clone, Copy)]
2626
pub struct ScoredResult<'a> {
@@ -32,7 +32,7 @@ const URL_PREFIX: &'static str = "http://example.com";
3232

3333
pub struct CatRank;
3434

35-
impl ::TestCase for CatRank {
35+
impl crate::TestCase for CatRank {
3636
type Request = search_result_list::Owned;
3737
type Response = search_result_list::Owned;
3838
type Expectation = i32;

benchmark/eval.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2020
// THE SOFTWARE.
2121

22-
use common::*;
23-
use eval_capnp::{expression, evaluation_result, Operation};
22+
use crate::common::*;
23+
use crate::eval_capnp::{expression, evaluation_result, Operation};
2424

2525
fn make_expression(rng: &mut FastRand, mut exp: expression::Builder, depth : u32) -> i32 {
2626
exp.set_op(::capnp::traits::FromU16::from_u16(rng.next_less_than( Operation::Modulus as u32 + 1) as u16).unwrap());
@@ -73,7 +73,7 @@ fn evaluate_expression(exp: expression::Reader) -> ::capnp::Result<i32> {
7373

7474
pub struct Eval;
7575

76-
impl ::TestCase for Eval {
76+
impl crate::TestCase for Eval {
7777
type Request = expression::Owned;
7878
type Response = evaluation_result::Owned;
7979
type Expectation = i32;

0 commit comments

Comments
 (0)