Use method rather than public field

This commit is contained in:
Ethan Brierley 2018-11-07 08:35:28 +00:00
parent f1a593d116
commit 11ee29a813

View file

@ -4768,8 +4768,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
#[derive(Debug, Clone, PartialEq, Eq)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct ParseIntError {
/// Stores the cause of parsing an integer failing
pub kind: IntErrorKind,
kind: IntErrorKind,
}
/// Enum to store the various types of errors that can cause parsing an integer to fail.
@ -4796,6 +4795,10 @@ pub enum IntErrorKind {
}
impl ParseIntError {
/// Outputs the detailed cause of parsing an integer failing.
pub fn kind(self) -> IntErrorKind {
self.kind
}
#[unstable(feature = "int_error_internals",
reason = "available through Error trait and this method should \
not be exposed publicly",