Skip to content

Commit 073cd01

Browse files
committed
mod_trait_exerci = "0.2.0"
1 parent 65fbc04 commit 073cd01

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

hello-mod-trait/lib-hello/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mod_trait_exerci"
3-
version = "0.1.3"
3+
version = "0.2.0"
44
authors = ["Gudao Luo <gudao.luo@gmail.com>"]
55
edition = "2018"
66
readme = "README.md"

hello-mod-trait/lib-hello/examples/bare_hello.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use mod_trait_exerci::mod_bare::StructType;
33
use mod_trait_exerci::mod_bare::TupleType;
44

55
fn get_data_from_struct(instances: [StructType; 2]) {
6-
let data = instances[0].get();
6+
let data = instances[0].get_tuple();
77
assert_eq!(0, data);
88
assert_eq!((0), data);
99
assert_eq!(instances[0], instances[1]);
@@ -12,7 +12,7 @@ fn get_data_from_struct(instances: [StructType; 2]) {
1212
}
1313

1414
fn get_data_from_tuple(instances: [TupleType; 2]) {
15-
let data = instances[0].get();
15+
let data = instances[0].get_tuple();
1616
assert_eq!(0, data);
1717
assert_eq!((0), data);
1818
assert_eq!(instances[0], instances[1]);

hello-mod-trait/lib-hello/examples/trait_instance_hello.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use mod_trait::StructType;
55
use mod_trait::TupleType;
66

77
fn get_data_from_struct(instances: [StructType; 2]) {
8-
let data = instances[0].get();
8+
let data = instances[0].get_tuple();
99
assert_eq!(0, data);
1010
assert_eq!((0), data);
1111
assert_eq!(instances[0], instances[1]);
@@ -14,7 +14,7 @@ fn get_data_from_struct(instances: [StructType; 2]) {
1414
}
1515

1616
fn get_data_from_tuple(instances: [TupleType; 2]) {
17-
let data = instances[0].get();
17+
let data = instances[0].get_tuple();
1818
assert_eq!(0, data);
1919
assert_eq!((0), data);
2020
assert_eq!(instances[0], instances[1]);

hello-mod-trait/lib-hello/tests/u_for_mod_bare.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ mod tests {
1111
#[test]
1212
fn it_works_with_struct_default() {
1313
let instance: StructType = Default::default();
14-
assert_eq!(0, instance.get());
15-
assert_eq!((0), instance.get());
14+
assert_eq!(0, instance.get_tuple());
15+
assert_eq!((0), instance.get_tuple());
1616
}
1717

1818
#[test]
1919
fn it_works_with_struct_struct() {
2020
let instance = StructType{data:(0)};
21-
assert_eq!(0, instance.get());
22-
assert_eq!((0), instance.get());
21+
assert_eq!(0, instance.get_tuple());
22+
assert_eq!((0), instance.get_tuple());
2323
}
2424

2525
#[test]
@@ -32,15 +32,15 @@ mod tests {
3232
#[test]
3333
fn it_works_with_tuple_default() {
3434
let instance: TupleType = Default::default();
35-
assert_eq!(0, instance.get());
36-
assert_eq!((0), instance.get());
35+
assert_eq!(0, instance.get_tuple());
36+
assert_eq!((0), instance.get_tuple());
3737
}
3838

3939
#[test]
4040
fn it_works_with_tuple_struct() {
4141
let instance = TupleType(0);
42-
assert_eq!(0, instance.get());
43-
assert_eq!((0), instance.get());
42+
assert_eq!(0, instance.get_tuple());
43+
assert_eq!((0), instance.get_tuple());
4444
}
4545

4646
#[test]

hello-mod-trait/lib-hello/tests/u_for_mod_trait_instance.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ mod tests {
1212
#[test]
1313
fn it_works_with_struct_default() {
1414
let instance: StructType = Default::default();
15-
assert_eq!(0, instance.get());
16-
assert_eq!((0), instance.get());
15+
assert_eq!(0, instance.get_tuple());
16+
assert_eq!((0), instance.get_tuple());
1717
}
1818

1919
#[test]
2020
fn it_works_with_struct_new() {
2121
let instance = StructType::new(0);
22-
assert_eq!(0, instance.get());
23-
assert_eq!((0), instance.get());
22+
assert_eq!(0, instance.get_tuple());
23+
assert_eq!((0), instance.get_tuple());
2424
}
2525

2626
#[test]
@@ -33,15 +33,15 @@ mod tests {
3333
#[test]
3434
fn it_works_with_tuple_default() {
3535
let instance: TupleType = Default::default();
36-
assert_eq!(0, instance.get());
37-
assert_eq!((0), instance.get());
36+
assert_eq!(0, instance.get_tuple());
37+
assert_eq!((0), instance.get_tuple());
3838
}
3939

4040
#[test]
4141
fn it_works_with_tuple_struct() {
4242
let instance = TupleType::new(0);
43-
assert_eq!(0, instance.get());
44-
assert_eq!((0), instance.get());
43+
assert_eq!(0, instance.get_tuple());
44+
assert_eq!((0), instance.get_tuple());
4545
}
4646

4747
#[test]

0 commit comments

Comments
 (0)