aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src/io
diff options
context:
space:
mode:
authorFenrirWolf <[email protected]>2018-06-10 11:49:19 -0600
committerGitHub <[email protected]>2018-06-10 11:49:19 -0600
commit49041a4e56a4cab33ae7889537d33670e8b012fb (patch)
tree0c931e8716200f9aa8c7daef47b62474d0285d5c /ctr-std/src/io
parentMerge pull request #69 from FenrirWolf/libctru-1.5.0 (diff)
parentFixes according to Fenrir's review (diff)
downloadctru-rs-49041a4e56a4cab33ae7889537d33670e8b012fb.tar.xz
ctru-rs-49041a4e56a4cab33ae7889537d33670e8b012fb.zip
Merge pull request #68 from linouxis9/master
Update for latest nightly 2018-05-06
Diffstat (limited to 'ctr-std/src/io')
-rw-r--r--ctr-std/src/io/buffered.rs2
-rw-r--r--ctr-std/src/io/cursor.rs2
-rw-r--r--ctr-std/src/io/mod.rs14
3 files changed, 17 insertions, 1 deletions
diff --git a/ctr-std/src/io/buffered.rs b/ctr-std/src/io/buffered.rs
index d6eac74..ee297d3 100644
--- a/ctr-std/src/io/buffered.rs
+++ b/ctr-std/src/io/buffered.rs
@@ -1251,6 +1251,7 @@ mod tests {
}
#[test]
+ #[allow(deprecated)]
fn read_char_buffered() {
let buf = [195, 159];
let reader = BufReader::with_capacity(1, &buf[..]);
@@ -1258,6 +1259,7 @@ mod tests {
}
#[test]
+ #[allow(deprecated)]
fn test_chars() {
let buf = [195, 159, b'a'];
let reader = BufReader::with_capacity(1, &buf[..]);
diff --git a/ctr-std/src/io/cursor.rs b/ctr-std/src/io/cursor.rs
index 2673f3c..8ac5257 100644
--- a/ctr-std/src/io/cursor.rs
+++ b/ctr-std/src/io/cursor.rs
@@ -566,6 +566,7 @@ mod tests {
}
#[test]
+ #[allow(deprecated)]
fn test_read_char() {
let b = &b"Vi\xE1\xBB\x87t"[..];
let mut c = Cursor::new(b).chars();
@@ -577,6 +578,7 @@ mod tests {
}
#[test]
+ #[allow(deprecated)]
fn test_read_bad_char() {
let b = &b"\x80"[..];
let mut c = Cursor::new(b).chars();
diff --git a/ctr-std/src/io/mod.rs b/ctr-std/src/io/mod.rs
index b02e133..eba4e9f 100644
--- a/ctr-std/src/io/mod.rs
+++ b/ctr-std/src/io/mod.rs
@@ -840,6 +840,9 @@ pub trait Read {
of where errors happen is currently \
unclear and may change",
issue = "27802")]
+ #[rustc_deprecated(since = "1.27.0", reason = "Use str::from_utf8 instead:
+ https://doc.rust-lang.org/nightly/std/str/struct.Utf8Error.html#examples")]
+ #[allow(deprecated)]
fn chars(self) -> Chars<Self> where Self: Sized {
Chars { inner: self }
}
@@ -2010,16 +2013,22 @@ impl<R: Read> Iterator for Bytes<R> {
/// [chars]: trait.Read.html#method.chars
#[unstable(feature = "io", reason = "awaiting stability of Read::chars",
issue = "27802")]
+#[rustc_deprecated(since = "1.27.0", reason = "Use str::from_utf8 instead:
+ https://doc.rust-lang.org/nightly/std/str/struct.Utf8Error.html#examples")]
#[derive(Debug)]
+#[allow(deprecated)]
pub struct Chars<R> {
inner: R,
}
/// An enumeration of possible errors that can be generated from the `Chars`
/// adapter.
-#[derive(Debug)]
#[unstable(feature = "io", reason = "awaiting stability of Read::chars",
issue = "27802")]
+#[rustc_deprecated(since = "1.27.0", reason = "Use str::from_utf8 instead:
+ https://doc.rust-lang.org/nightly/std/str/struct.Utf8Error.html#examples")]
+#[derive(Debug)]
+#[allow(deprecated)]
pub enum CharsError {
/// Variant representing that the underlying stream was read successfully
/// but it did not contain valid utf8 data.
@@ -2031,6 +2040,7 @@ pub enum CharsError {
#[unstable(feature = "io", reason = "awaiting stability of Read::chars",
issue = "27802")]
+#[allow(deprecated)]
impl<R: Read> Iterator for Chars<R> {
type Item = result::Result<char, CharsError>;
@@ -2063,6 +2073,7 @@ impl<R: Read> Iterator for Chars<R> {
#[unstable(feature = "io", reason = "awaiting stability of Read::chars",
issue = "27802")]
+#[allow(deprecated)]
impl std_error::Error for CharsError {
fn description(&self) -> &str {
match *self {
@@ -2080,6 +2091,7 @@ impl std_error::Error for CharsError {
#[unstable(feature = "io", reason = "awaiting stability of Read::chars",
issue = "27802")]
+#[allow(deprecated)]
impl fmt::Display for CharsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {