Skip to content

Commit

Permalink
Fixed example codes
Browse files Browse the repository at this point in the history
  • Loading branch information
maiha authored and asterite committed Jan 6, 2017
1 parent 8ab3a34 commit 8328757
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/array.cr
Expand Up @@ -960,7 +960,7 @@ class Array(T)
# ```
# a = [1, 2, 3]
# sums = [] of Int32
# a.each_permutation(2) { |p| sums << p.sum } # => [1, 2, 3]
# a.each_permutation(2) { |p| sums << p.sum } # => nil
# sums # => [3, 4, 3, 5, 4, 5]
# ```
#
Expand Down
6 changes: 3 additions & 3 deletions src/big/big_int.cr
Expand Up @@ -289,9 +289,9 @@ struct BigInt < Int
# Returns a string containing the representation of big radix base (2 through 36).
#
# ```
# BigInt.new("123456789101101987654321").to_s(8) # => 32111154373025463465765261
# BigInt.new("123456789101101987654321").to_s(16) # => 1a249b1f61599cd7eab1
# BigInt.new("123456789101101987654321").to_s(36) # => k3qmt029k48nmpd
# BigInt.new("123456789101101987654321").to_s(8) # => "32111154373025463465765261"
# BigInt.new("123456789101101987654321").to_s(16) # => "1a249b1f61599cd7eab1"
# BigInt.new("123456789101101987654321").to_s(36) # => "k3qmt029k48nmpd"
# ```
def to_s(base : Int)
raise "Invalid base #{base}" unless 2 <= base <= 36
Expand Down
2 changes: 1 addition & 1 deletion src/html.cr
Expand Up @@ -39,7 +39,7 @@ module HTML
# require "html"
#
# io = IO::Memory.new
# HTML.escape("Crystal & You", io) # => "Crystal & You"
# HTML.escape("Crystal & You", io) # => nil
# io.to_s # => "Crystal &amp; You"
# ```
def self.escape(string : String, io : IO)
Expand Down
2 changes: 1 addition & 1 deletion src/static_array.cr
Expand Up @@ -130,7 +130,7 @@ struct StaticArray(T, N)
#
# ```
# array = StaticArray(Int32, 3).new { |i| i + 1 }
# array.[]= 2 # => 3
# array.[]= 2 # => nil
# array # => StaticArray[2, 2, 2]
# ```
def []=(value : T)
Expand Down

0 comments on commit 8328757

Please sign in to comment.