Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

eql

Private Function
std.Build.LazyPath.eql
fn eql(a: LazyPath, b: LazyPath) bool

Params

File

Build.zig:2407
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
    fn eql(a: LazyPath, b: LazyPath) bool {
        if (std.meta.activeTag(a) != b) return false;
        switch (a) {
            .src_path => |a_sp| {
                const b_sp = b.src_path;
                if (a_sp.owner != b_sp.owner) return false;
                if (mem.eql(u8, a_sp.sub_path, b_sp.sub_path)) return false;
            },
            .generated => |*a_gen| {
                const b_gen = &b.generated;
                if (a_gen.index != b_gen.index) return false;
                if (a_gen.up != b_gen.up) return false;
                if (mem.eql(u8, a_gen.sub_path, b_gen.sub_path)) return false;
            },
            .cwd_relative => |a_rel_path| {
                const b_rel_path = b.cwd_relative;
                if (!mem.eql(u8, a_rel_path, b_rel_path)) return false;
            },
            .relative => |a_relative| return a_relative.eql(b.relative),
            .dependency => |a_dep| {
                const b_dep = b.dependency;
                if (a_dep.dependency != b_dep.dependency) return false;
                if (!mem.eql(u8, a_dep.sub_path, b_dep.sub_path)) return false;
            },
        }
        return true;
    }