Skip to content

Commit

Permalink
Remove dead code and fix documentation.
Browse files Browse the repository at this point in the history
The documentation for BatInt.of_string was misleading:
The current implementation throws Failure, not Invalid_argument.

This is because the implementation being referred to was dead code,
which is being removed in this commit.
  • Loading branch information
jkloos authored and gasche committed Dec 6, 2016
1 parent 60d4c27 commit 9fc8b3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/batInt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ module BaseInt = struct
external to_int : int -> int = "%identity"


let of_string x =
try int_of_string x
with Failure err -> raise (Invalid_argument err)
let to_string = string_of_int

let enum = enum
Expand Down
4 changes: 2 additions & 2 deletions src/batInt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ val of_string : string -> int
The string is read in decimal (by default) or in hexadecimal,
octal or binary if the string begins with [0x], [0o] or [0b]
respectively.
@raise Invalid_argument if the given string is not
@raise Failure if the given string is not
a valid representation of an integer, or if the integer represented
exceeds the range of integers representable in type [int]. *)

Expand Down Expand Up @@ -354,7 +354,7 @@ module Safe_int : sig
The string is read in decimal (by default) or in hexadecimal,
octal or binary if the string begins with [0x], [0o] or [0b]
respectively.
@raise Invalid_argument if the given string is not
@raise Failure if the given string is not
a valid representation of an integer, or if the integer represented
exceeds the range of integers representable in type [int]. *)

Expand Down

0 comments on commit 9fc8b3d

Please sign in to comment.