Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use :nodoc: when overriding public methods #11096

Merged
merged 1 commit into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/array.cr
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ class Array(T)
equals?(other) { |x, y| x == y }
end

# :nodoc:
def ==(other)
false
end
Expand Down Expand Up @@ -1052,7 +1051,6 @@ class Array(T)
self
end

# :nodoc:
def inspect(io : IO) : Nil
to_s io
end
Expand Down Expand Up @@ -2268,7 +2266,6 @@ class Array(T)
end
end

# :nodoc:
def index(object, offset : Int = 0)
# Optimize for the case of looking for a byte in a byte slice
if T.is_a?(UInt8.class) &&
Expand Down
1 change: 0 additions & 1 deletion src/big/big_int.cr
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ struct BigInt < Int
end
end

# :nodoc:
def digits(base = 10) : Array(Int32)
if self < 0
raise ArgumentError.new("Can't request digits of negative number")
Expand Down
1 change: 0 additions & 1 deletion src/compress/deflate/reader.cr
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ class Compress::Deflate::Reader < IO
initialize(@io, @sync_close, @dict)
end

# :nodoc:
def inspect(io : IO) : Nil
to_s(io)
end
Expand Down
1 change: 0 additions & 1 deletion src/compress/deflate/writer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class Compress::Deflate::Writer < IO
@closed
end

# :nodoc:
def inspect(io : IO) : Nil
to_s(io)
end
Expand Down
2 changes: 0 additions & 2 deletions src/crystal/datum.cr
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,10 @@ module Crystal
self[index_or_key]
end

# :nodoc:
def inspect(io : IO) : Nil
@raw.inspect(io)
end

# :nodoc:
def to_s(io : IO) : Nil
@raw.to_s(io)
end
Expand Down
1 change: 0 additions & 1 deletion src/enum.cr
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ struct Enum
value <=> other.value
end

# :nodoc:
def ==(other)
false
end
Expand Down
6 changes: 5 additions & 1 deletion src/indexable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,11 @@ module Indexable(T)
unsafe_fetch(random.rand(size))
end

# :nodoc:
# :inherit:
#
# If `self` is not empty and `n` is equal to 1, calls `sample(random)` exactly
# once. Thus, *random* will be left in a different state compared to the
# implementation in `Enumerable`.
def sample(n : Int, random = Random::DEFAULT) : Array(T)
return super unless n == 1

Expand Down
4 changes: 0 additions & 4 deletions src/io/memory.cr
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ class IO::Memory < IO
string
end

# :nodoc:
def read_byte : UInt8?
check_open

Expand All @@ -184,7 +183,6 @@ class IO::Memory < IO
end
end

# :nodoc:
def peek : Bytes
check_open

Expand All @@ -203,14 +201,12 @@ class IO::Memory < IO
end
end

# :nodoc:
def skip_to_end : Nil
check_open

@pos = @bytesize
end

# :nodoc:
def gets_to_end : String
return super if @encoding

Expand Down
2 changes: 0 additions & 2 deletions src/json/any.cr
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,10 @@ struct JSON::Any
as_h if @raw.is_a?(Hash)
end

# :nodoc:
def inspect(io : IO) : Nil
@raw.inspect(io)
end

# :nodoc:
def to_s(io : IO) : Nil
@raw.to_s(io)
end
Expand Down
1 change: 0 additions & 1 deletion src/log/metadata.cr
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ class Log::Metadata
true
end

# :nodoc:
def ==(other)
false
end
Expand Down
19 changes: 14 additions & 5 deletions src/range.cr
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,12 @@ struct Range(B, E)
includes?(value)
end

# :nodoc:
def to_s(io : IO) : Nil
@begin.try &.inspect(io)
io << (@exclusive ? "..." : "..")
@end.try &.inspect(io)
end

# :nodoc:
def inspect(io : IO) : Nil
to_s(io)
end
Expand Down Expand Up @@ -387,7 +385,11 @@ struct Range(B, E)
{% end %}
end

# :nodoc:
# :inherit:
#
# If `self` is not empty and `n` is equal to 1, calls `sample(random)` exactly
# once. Thus, *random* will be left in a different state compared to the
# implementation in `Enumerable`.
def sample(n : Int, random = Random::DEFAULT)
{% if B == Nil || E == Nil %}
{% raise "Can't sample an open range" %}
Expand All @@ -411,7 +413,6 @@ struct Range(B, E)
Range.new(@begin.clone, @end.clone, @exclusive)
end

# :nodoc:
def map(&block : B -> U) forall U
b = self.begin
e = self.end
Expand All @@ -427,7 +428,15 @@ struct Range(B, E)
end
end

# :nodoc:
# Returns the number of values in this range.
#
# If both the beginning and the end of this range are `Int`s, runs in constant
# time instead of linear.
#
# ```
# (3..8).size # => 5
# (3...8).size # => 6
# ```
def size
{% if B == Nil || E == Nil %}
{% raise "Can't calculate size of an open range" %}
Expand Down
1 change: 0 additions & 1 deletion src/slice.cr
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,6 @@ struct Slice(T)
self
end

# :nodoc:
def index(object, offset : Int = 0)
# Optimize for the case of looking for a byte in a byte slice
if T.is_a?(UInt8.class) &&
Expand Down
1 change: 0 additions & 1 deletion src/static_array.cr
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ struct StaticArray(T, N)
array
end

# :nodoc:
def index(object, offset : Int = 0)
# Optimize for the case of looking for a byte in a byte slice
if T.is_a?(UInt8.class) &&
Expand Down
2 changes: 0 additions & 2 deletions src/yaml/any.cr
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,10 @@ struct YAML::Any
@raw.as?(Bytes)
end

# :nodoc:
def inspect(io : IO) : Nil
@raw.inspect(io)
end

# :nodoc:
def to_s(io : IO) : Nil
@raw.to_s(io)
end
Expand Down