Browse Source

docs(lalgebra_vector) switch addition to var + var, instead of var plus dereferenced ptr

pull/1177/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
168a3c495f
  1. 6
      subjects/lalgebra_vector/README.md

6
subjects/lalgebra_vector/README.md

@ -8,10 +8,6 @@ Define the associated function `dot`, that calculates the dot product between tw
Note: `Vector` must implement `Debug`, `Clone`, `Eq` and `PartialEq`. Note: `Vector` must implement `Debug`, `Clone`, `Eq` and `PartialEq`.
#### Important
Note that in the addition of vector of the example the `Rhs` is not `Self`
### Expected Functions and Structure ### Expected Functions and Structure
```rust ```rust
@ -42,7 +38,7 @@ fn main() {
let vector_1: Vector<i64> = Vector(vec![1, 3, -5]); let vector_1: Vector<i64> = Vector(vec![1, 3, -5]);
let vector_2: Vector<i64> = Vector(vec![4, -2, -1]); let vector_2: Vector<i64> = Vector(vec![4, -2, -1]);
println!("{:?}", vector_1.dot(&vector_2)); println!("{:?}", vector_1.dot(&vector_2));
println!("{:?}", vector_1 + &vector_2); println!("{:?}", vector_1 + vector_2);
} }
``` ```

Loading…
Cancel
Save