We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent befee27 commit ebc7a92Copy full SHA for ebc7a92
testdata/rust/0_rust2/src/entity/inter.rs
@@ -19,23 +19,25 @@ pub trait Addable {
19
20
pub struct AnyInt(i64);
21
22
-//impl AnyInt {
23
-// pub fn id() -> i64 {
24
-// 0
25
-// }
26
-// pub fn add(&self, b: i64) -> i64 {
27
-// self.0 + b
28
29
-//}
+impl AnyInt {
+ //pub fn id() -> i64 {
+ pub fn idx() -> i64 {
+ 0
+ }
+ //pub fn add(&self, b: i64) -> i64 {
+ pub fn addx(&self, b: i64) -> i64 {
+ self.0 + b
30
31
+}
32
33
impl Addable for AnyInt {
34
fn add(&self, b: i64) -> i64 {
35
// use the method defined in the struct
- self.add(b)
36
+ self.addx(b)
37
}
38
fn id() -> i64 {
39
- AnyInt::id()
40
+ AnyInt::idx()
41
42
43
0 commit comments