Skip to content

Commit 2529848

Browse files
committed
fix typos (see #336)
1 parent a7a0d16 commit 2529848

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/src/advanced.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Structures with non-standard data layout
44

5-
StructArrays support structures with custom data layout. The user is required to overload `staticschema` in order to define the custom layout, `component` to access fields of the custom layout, and `createinstance(T, fields...)` to create an instance of type `T` from its custom fields `fields`. In other word, given `x::T`, `createinstance(T, (component(x, f) for f in fieldnames(staticschema(T)))...)` should successfully return an instance of type `T`.
5+
StructArrays supports structures with custom data layout. The user is required to overload `staticschema` in order to define the custom layout, `component` to access fields of the custom layout, and `createinstance(T, fields...)` to create an instance of type `T` from its custom fields `fields`. In other words, given `x::T`, `createinstance(T, (component(x, f) for f in fieldnames(staticschema(T)))...)` should successfully return an instance of type `T`.
66

7-
Here is an example of a type `MyType` that has as custom fields either its field `data` or fields of its field `rest` (which is a named tuple):
7+
Here is an example of a type `MyType` that has custom fields that are either its `data` field or the fields of its `rest` field (which is a `NamedTuple`):
88

99
```@repl advanced1
1010
using StructArrays

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ maybe_convert_elt(::Type{T}, vals::Tuple) where T = T <: Tuple ? convert(T, vals
194194
maybe_convert_elt(::Type{T}, vals::NamedTuple) where T = T<:NamedTuple ? convert(T, vals) : vals # assignment of fields by name
195195

196196
"""
197-
findconsistentvalue(f, componenents::Union{Tuple, NamedTuple})
197+
findconsistentvalue(f, components::Union{Tuple, NamedTuple})
198198
199-
Compute the unique value that `f` takes on each `component ∈ componenents`.
199+
Compute the unique value that `f` takes on each `component ∈ components`.
200200
If not all values are equal, return `nothing`. Otherwise, return the unique value.
201201
"""
202202
function findconsistentvalue(f::F, cols::Tup) where F

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ end
12461246
# We use them to simulate `BroadcastStyle` overloading `Base.copyto!`.
12471247
# 2. `MyArray3` has no `similar` defined.
12481248
# We use it to simulate `BroadcastStyle` overloading `Base.copy`.
1249-
# 3. Their resolved style could be summaryized as (`-` means conflict)
1249+
# 3. Their resolved style could be summarized as (`-` means conflict)
12501250
# | MyArray1 | MyArray2 | MyArray3 | Array
12511251
# -------------------------------------------------------------
12521252
# MyArray1 | MyArray1 | - | MyArray1 | MyArray1

0 commit comments

Comments
 (0)