mirror of
https://codeberg.org/ziglings/exercises.git
synced 2024-12-27 01:46:29 +00:00
Merge pull request #209 from chrboesch/e70
changed self parameter in connect to pointer
This commit is contained in:
commit
b75a76d072
1 changed files with 2 additions and 2 deletions
|
@ -70,7 +70,7 @@ const Duct = struct {
|
||||||
galvanized: bool,
|
galvanized: bool,
|
||||||
connection: ?*Duct = null,
|
connection: ?*Duct = null,
|
||||||
|
|
||||||
fn connect(self: Duct, other: *Duct) !void {
|
fn connect(self: *Duct, other: *Duct) !void {
|
||||||
if (self.diameter == other.diameter) {
|
if (self.diameter == other.diameter) {
|
||||||
self.connection = other;
|
self.connection = other;
|
||||||
} else {
|
} else {
|
||||||
|
@ -95,7 +95,7 @@ pub fn main() void {
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is not even remotely a duck.
|
// This is not even remotely a duck.
|
||||||
const ducky3 = Duct{
|
var ducky3 = Duct{
|
||||||
.diameter = 17,
|
.diameter = 17,
|
||||||
.length = 165,
|
.length = 165,
|
||||||
.galvanized = true,
|
.galvanized = true,
|
||||||
|
|
Loading…
Reference in a new issue