diff options
| author | Ethan Brierley <ethanboxx@gmail.com> | 2018-11-07 08:35:28 +0000 |
|---|---|---|
| committer | Ethan Brierley <ethanboxx@gmail.com> | 2018-11-07 08:35:28 +0000 |
| commit | 11ee29a81397d5c18eb69fd5e12f977c07e1c851 (patch) | |
| tree | 60d5e0a210c3539c151970812fde0022957aadb5 /src/libcore | |
| parent | f1a593d1162dc399222c219a261bc95126e7fa62 (diff) | |
| download | rust-11ee29a81397d5c18eb69fd5e12f977c07e1c851.tar.gz rust-11ee29a81397d5c18eb69fd5e12f977c07e1c851.zip | |
Use method rather than public field
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/num/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index a7b6d719c6a..e297050f1f0 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -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", |
