Skip to content

Commit 11ee29a

Browse files
committed
Use method rather than public field
1 parent f1a593d commit 11ee29a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libcore/num/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4768,8 +4768,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
47684768
#[derive(Debug, Clone, PartialEq, Eq)]
47694769
#[stable(feature = "rust1", since = "1.0.0")]
47704770
pub struct ParseIntError {
4771-
/// Stores the cause of parsing an integer failing
4772-
pub kind: IntErrorKind,
4771+
kind: IntErrorKind,
47734772
}
47744773

47754774
/// Enum to store the various types of errors that can cause parsing an integer to fail.
@@ -4796,6 +4795,10 @@ pub enum IntErrorKind {
47964795
}
47974796

47984797
impl ParseIntError {
4798+
/// Outputs the detailed cause of parsing an integer failing.
4799+
pub fn kind(self) -> IntErrorKind {
4800+
self.kind
4801+
}
47994802
#[unstable(feature = "int_error_internals",
48004803
reason = "available through Error trait and this method should \
48014804
not be exposed publicly",

0 commit comments

Comments
 (0)