mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tools: format most examples and tutorials, add them to v test-cleancode
(#9826)
This commit is contained in:
@ -20,7 +20,7 @@ pub fn (mut v Vec2) from(src Vec2) {
|
||||
|
||||
// * Addition
|
||||
// + operator overload. Adds two vectors
|
||||
pub fn (v1 Vec2) +(v2 Vec2) Vec2 {
|
||||
pub fn (v1 Vec2) + (v2 Vec2) Vec2 {
|
||||
return Vec2{v1.x + v2.x, v1.y + v2.y}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ pub fn (mut v Vec2) plus_f64(scalar f64) {
|
||||
}
|
||||
|
||||
// * Subtraction
|
||||
pub fn (v1 Vec2) -(v2 Vec2) Vec2 {
|
||||
pub fn (v1 Vec2) - (v2 Vec2) Vec2 {
|
||||
return Vec2{v1.x - v2.x, v1.y - v2.y}
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ pub fn (mut v Vec2) subtract_f64(scalar f64) {
|
||||
}
|
||||
|
||||
// * Multiplication
|
||||
pub fn (v1 Vec2) *(v2 Vec2) Vec2 {
|
||||
pub fn (v1 Vec2) * (v2 Vec2) Vec2 {
|
||||
return Vec2{v1.x * v2.x, v1.y * v2.y}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user