Add more comments and examples.
This commit is contained in:
@@ -35,7 +35,7 @@ fn test_array_with_structs() -> Result<(), EvalAltResult> {
|
||||
self.x = new_x;
|
||||
}
|
||||
|
||||
fn new() -> TestStruct {
|
||||
fn new() -> Self {
|
||||
TestStruct { x: 1 }
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ fn struct_with_float() -> Result<(), EvalAltResult> {
|
||||
self.x = new_x;
|
||||
}
|
||||
|
||||
fn new() -> TestStruct {
|
||||
fn new() -> Self {
|
||||
TestStruct { x: 1.0 }
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ fn test_get_set() -> Result<(), EvalAltResult> {
|
||||
self.x = new_x;
|
||||
}
|
||||
|
||||
fn new() -> TestStruct {
|
||||
fn new() -> Self {
|
||||
TestStruct { x: 1 }
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ fn test_method_call() -> Result<(), EvalAltResult> {
|
||||
self.x += 1000;
|
||||
}
|
||||
|
||||
fn new() -> TestStruct {
|
||||
fn new() -> Self {
|
||||
TestStruct { x: 1 }
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ fn test_mismatched_op_custom_type() {
|
||||
}
|
||||
|
||||
impl TestStruct {
|
||||
fn new() -> TestStruct {
|
||||
fn new() -> Self {
|
||||
TestStruct { x: 1 }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user