Skip to content

Commit df47dc3

Browse files
authored
Merge pull request #5 from jhchabran/main
Fix very minor typo mistake + punctuations
2 parents 1a54576 + e1f8552 commit df47dc3

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/field_parent_ptr.zig

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
//!
33
//! When to use:
44
//! - When you want to call one function with a unified interface
5-
//! whose implementers share common fields
5+
//! whose implementers share common fields.
66
//!
77
//! When not to use:
88
//! - If you have a lot of common functions and few / no common fields
9-
//! - You could use a vtable
10-
//! - You could use an `inline switch`
9+
//! - You could use a vtable.
10+
//! - You could use an `inline switch`.
1111
//! - If you want type correctness guarantees at compile time, use
12-
//! a type function
12+
//! a type function instead.
1313

1414
const std = @import("std");
1515

src/inline_switch.zig

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! When to use:
2-
//! - When you don't want runtime overhead
3-
//! - When you want reasonably strong type correctness guarantees
4-
//! - this avoids most runtime errors potentially found in other techniques
2+
//! - When you don't want runtime overhead.
3+
//! - When you want reasonably strong type correctness guarantees.
4+
//! - This avoids most runtime errors potentially found in other techniques.
55
//!
66
//! When not to use:
7-
//! - If you want extensability! This solution is not extensible in any way;
7+
//! - If you want extensibility! This solution is not extensible in any way, i.e.
88
//! a user would have to modify the structure directly.
99

1010
const std = @import("std");

src/type_function.zig

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
//! time values and return a type.
77
//!
88
//! Here, we create an an all-encompassing type function, Contribution,
9-
//! that given a summarize function and associated types will call that
9+
//! that given a summarize function and associated types, will call that
1010
//! function with additional logic.
1111
//!
1212
//! Each call to Contribution with unique parameters returns
1313
//! a unique type.
1414
//!
1515
//! When to use:
16-
//! - When you don't want runtime overhead
17-
//! - When you want incredibly strong type correctness guarantees
18-
//! - this avoids most runtime errors potentially found in other techniques
19-
//! - you can also use @compileError to make certain behaviors illegal
20-
//! 100% at compile time
21-
//! - When you want your structure to be easily extended from Zig code
16+
//! - When you don't want runtime overhead.
17+
//! - When you want incredibly strong type correctness guarantees.
18+
//! - This avoids most runtime errors potentially found in other techniques.
19+
//! - You can also use @compileError to make certain behaviors illegal
20+
//! 100% at compile time.
21+
//! - When you want your structure to be easily extended from Zig code.
2222
//!
2323
//! When not to use:
2424
//! - If you want to store all instances in a variable of a single type
2525
//! (there is no single type like in the vtable or @fieldParentPtr examples,
26-
//! so this is not possible)
26+
//! so this is not possible).
2727

2828
const std = @import("std");
2929

src/vtable.zig

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//! with very few / no common fields.
44
//!
55
//! When not to use:
6-
//! - If you have a lot of common fields, you could use `@fieldParentPtr`
6+
//! - If you have a lot of common fields, you could use `@fieldParentPtr` instead.
77
//! - If you have only one common function, you could replace the vtable pointer
8-
//! with a function pointer (I'd call this a "type erased")
8+
//! with a function pointer (I'd call this a "type erased").
99

1010
const std = @import("std");
1111

0 commit comments

Comments
 (0)