Skip to content

Commit 3266dd0

Browse files
authored
Fix method signatures in docstrings (#17)
Markdown doesn't recognize code blocks with indents unless it's exactly 4 indents, so Documenter doesn't render them properly either
1 parent 00573d2 commit 3266dd0

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/StructUtils.jl

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ struct DefaultStyle <: StructStyle end
2525
include("macros.jl")
2626

2727
"""
28-
StructUtils.dictlike(x) -> Bool
29-
StructUtils.dictlike(::StructStyle, x) -> Bool
30-
StructUtils.dictlike(::StructStyle, ::Type{T}) -> Bool
28+
StructUtils.dictlike(x) -> Bool
29+
StructUtils.dictlike(::StructStyle, x) -> Bool
30+
StructUtils.dictlike(::StructStyle, ::Type{T}) -> Bool
3131
3232
Returns `true` if `x` or type `T` is dictionary-like, `false` otherwise.
3333
When `StructUtils.make(T, source)` is called, if `dictlike(T)` is `true`,
@@ -43,9 +43,9 @@ dictlike(::Type{<:AbstractVector{<:Pair}}) = true
4343
dictlike(@nospecialize(T)) = false
4444

4545
"""
46-
StructUtils.noarg(x) -> Bool
47-
StructUtils.noarg(::StructStyle, x) -> Bool
48-
StructUtils.noarg(::StructStyle, ::Type{T}) -> Bool
46+
StructUtils.noarg(x) -> Bool
47+
StructUtils.noarg(::StructStyle, x) -> Bool
48+
StructUtils.noarg(::StructStyle, ::Type{T}) -> Bool
4949
5050
Signals that `x` or type `T` is a mutable type that can be constructed by calling an empty
5151
constructor, like `t = T()`. Automatically overloaded when structs use the
@@ -59,9 +59,9 @@ noarg(::StructStyle, T::Type) = noarg(T)
5959
noarg(@nospecialize(T)) = false
6060

6161
"""
62-
StructUtils.kwarg(x) -> Bool
63-
StructUtils.kwarg(::StructStyle, x) -> Bool
64-
StructUtils.kwarg(::StructStyle, ::Type{T}) -> Bool
62+
StructUtils.kwarg(x) -> Bool
63+
StructUtils.kwarg(::StructStyle, x) -> Bool
64+
StructUtils.kwarg(::StructStyle, ::Type{T}) -> Bool
6565
6666
Signals that `x` or type `T` can be constructed by passing struct fields as keyword arguments
6767
to the constructor, like `t = T(field1=a, field2=b, ...)`. Automatically overloaded
@@ -193,9 +193,9 @@ _valtype(d) = valtype(d)
193193
_valtype(::AbstractVector{Pair{A,B}}) where {A,B} = B
194194

195195
"""
196-
StructUtils.arraylike(x) -> Bool
197-
StructUtils.arraylike(::StructStyle, x) -> Bool
198-
StructUtils.arraylike(::StructStyle, ::Type{T}) -> Bool
196+
StructUtils.arraylike(x) -> Bool
197+
StructUtils.arraylike(::StructStyle, x) -> Bool
198+
StructUtils.arraylike(::StructStyle, ::Type{T}) -> Bool
199199
200200
Returns `true` if `x` or type `T` is array-like, `false` otherwise. This function is
201201
called by `StructUtils.make` to determine if `T` is array-like. The default
@@ -218,9 +218,9 @@ arraylike(::Type{<:Core.SimpleVector}) = true
218218
arraylike(@nospecialize(T)) = false
219219

220220
"""
221-
StructUtils.structlike(x) -> Bool
222-
StructUtils.structlike(::StructStyle, x) -> Bool
223-
StructUtils.structlike(::StructStyle, ::Type{T}) -> Bool
221+
StructUtils.structlike(x) -> Bool
222+
StructUtils.structlike(::StructStyle, x) -> Bool
223+
StructUtils.structlike(::StructStyle, ::Type{T}) -> Bool
224224
225225
Returns `true` if `x` or type `T` is struct-like, `false` otherwise. This function is
226226
called by `StructUtils.make` to determine if `T` is struct-like. The default
@@ -256,9 +256,9 @@ structlike(@nospecialize(x)) = structlike(typeof(x))
256256
structlike(@nospecialize(T::Type)) = isstructtype(T) && !Base.issingletontype(T)
257257

258258
"""
259-
StructUtils.nulllike(x) -> Bool
260-
StructUtils.nulllike(::StructStyle, x) -> Bool
261-
StructUtils.nulllike(::StructStyle, ::Type{T}) -> Bool
259+
StructUtils.nulllike(x) -> Bool
260+
StructUtils.nulllike(::StructStyle, x) -> Bool
261+
StructUtils.nulllike(::StructStyle, ::Type{T}) -> Bool
262262
263263
Returns `true` if `x` or type `T` is null-like, `false` otherwise. This function is
264264
mainly used in the `make!` implementation to determine if a
@@ -271,8 +271,8 @@ nulllike(::StructStyle, T::Type) = nulllike(T)
271271
nulllike(@nospecialize(T)) = T === Missing || T === Nothing
272272

273273
"""
274-
StructUtils.lower(x) -> x
275-
StructUtils.lower(::StructStyle, x) -> x
274+
StructUtils.lower(x) -> x
275+
StructUtils.lower(::StructStyle, x) -> x
276276
277277
Domain value transformation function. This function is called by
278278
`StructUtils.applyeach` on each value in the `source` object before
@@ -297,8 +297,8 @@ function lower(st::StructStyle, x, tags)
297297
end
298298

299299
"""
300-
StructUtils.lowerkey(x) -> x
301-
StructUtils.lowerkey(style::StructUtils.StructStyle, x) -> x
300+
StructUtils.lowerkey(x) -> x
301+
StructUtils.lowerkey(style::StructUtils.StructStyle, x) -> x
302302
303303
Allows customizing how a value is lowered when used specifically as a key.
304304
By default, calls [`StructUtils.lower`](@ref). Called from [`StructUtils.applyeach`](@ref)
@@ -327,8 +327,8 @@ lowerkey(::StructStyle, x) = lowerkey(x)
327327
lowerkey(x) = x
328328

329329
"""
330-
StructUtils.lift(::Type{T}, x) -> T
331-
StructUtils.lift(::StructStyle, ::Type{T}, x) -> Tuple{T, Any}
330+
StructUtils.lift(::Type{T}, x) -> T
331+
StructUtils.lift(::StructStyle, ::Type{T}, x) -> Tuple{T, Any}
332332
333333
Lifts a value `x` to a type `T`. This function is called by `StructUtils.make`
334334
to lift unit/atom values to the appropriate type. The default implementation is
@@ -389,8 +389,8 @@ function lift(st::StructStyle, ::Type{T}, x, tags) where {T}
389389
end
390390

391391
"""
392-
StructUtils.liftkey(::Type{T}, x) -> x
393-
StructUtils.liftkey(style::StructStyle, ::Type{T}, x) -> x
392+
StructUtils.liftkey(::Type{T}, x) -> x
393+
StructUtils.liftkey(style::StructStyle, ::Type{T}, x) -> x
394394
395395
Allows customizing how a key is lifted before being passed to [`addkeyval!`](@ref)
396396
in `dictlike` construction.
@@ -1013,7 +1013,7 @@ end
10131013
@doc (@doc make) make!
10141014

10151015
"""
1016-
StructUtils.reset!(x::T)
1016+
StructUtils.reset!(x::T)
10171017
10181018
If `T` was defined with default values via `@defaults`, `@tags`, `@kwarg`, or `@noarg`,
10191019
`reset!` will reset the fields of `x` to their default values.

0 commit comments

Comments
 (0)