1
0
Fork 0
mirror of https://github.com/ratfactor/ziglings synced 2024-05-05 01:56:03 +02:00

changed self parameter in connect to pointer

This commit is contained in:
Chris Boesch 2023-03-31 12:18:57 +02:00
parent e9735900ae
commit c4086ab252

View File

@ -70,7 +70,7 @@ const Duct = struct {
galvanized: bool,
connection: ?*Duct = null,
fn connect(self: Duct, other: *Duct) !void {
fn connect(self: *Duct, other: *Duct) !void {
if (self.diameter == other.diameter) {
self.connection = other;
} else {
@ -95,7 +95,7 @@ pub fn main() void {
};
// This is not even remotely a duck.
const ducky3 = Duct{
var ducky3 = Duct{
.diameter = 17,
.length = 165,
.galvanized = true,