summaryrefslogtreecommitdiffstats
path: root/src/doc/book/listings/ch09-error-handling
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:13:23 +0000
commit20431706a863f92cb37dc512fef6e48d192aaf2c (patch)
tree2867f13f5fd5437ba628c67d7f87309ccadcd286 /src/doc/book/listings/ch09-error-handling
parentReleasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff)
downloadrustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz
rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/doc/book/listings/ch09-error-handling')
-rw-r--r--src/doc/book/listings/ch09-error-handling/listing-09-07/src/main.rs3
-rw-r--r--src/doc/book/listings/ch09-error-handling/listing-09-08/src/main.rs3
-rw-r--r--src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.lock16
-rw-r--r--src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.toml2
-rw-r--r--src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock16
-rw-r--r--src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml2
6 files changed, 12 insertions, 30 deletions
diff --git a/src/doc/book/listings/ch09-error-handling/listing-09-07/src/main.rs b/src/doc/book/listings/ch09-error-handling/listing-09-07/src/main.rs
index f4564f670..0295949d2 100644
--- a/src/doc/book/listings/ch09-error-handling/listing-09-07/src/main.rs
+++ b/src/doc/book/listings/ch09-error-handling/listing-09-07/src/main.rs
@@ -1,7 +1,6 @@
// ANCHOR: here
use std::fs::File;
-use std::io;
-use std::io::Read;
+use std::io::{self, Read};
fn read_username_from_file() -> Result<String, io::Error> {
let mut username_file = File::open("hello.txt")?;
diff --git a/src/doc/book/listings/ch09-error-handling/listing-09-08/src/main.rs b/src/doc/book/listings/ch09-error-handling/listing-09-08/src/main.rs
index c3c6e23ef..ca672caad 100644
--- a/src/doc/book/listings/ch09-error-handling/listing-09-08/src/main.rs
+++ b/src/doc/book/listings/ch09-error-handling/listing-09-08/src/main.rs
@@ -1,7 +1,6 @@
// ANCHOR: here
use std::fs::File;
-use std::io;
-use std::io::Read;
+use std::io::{self, Read};
fn read_username_from_file() -> Result<String, io::Error> {
let mut username = String::new();
diff --git a/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.lock b/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.lock
index 0a2f222c2..2ae9e459e 100644
--- a/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.lock
+++ b/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.lock
@@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -38,14 +40,13 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]]
name = "rand"
-version = "0.8.3"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
"rand_chacha",
"rand_core",
- "rand_hc",
]
[[package]]
@@ -68,15 +69,6 @@ dependencies = [
]
[[package]]
-name = "rand_hc"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
-dependencies = [
- "rand_core",
-]
-
-[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.toml b/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.toml
index 15b3fffca..d508e9578 100644
--- a/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.toml
+++ b/src/doc/book/listings/ch09-error-handling/listing-09-13/Cargo.toml
@@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2021"
[dependencies]
-rand = "0.8.3"
+rand = "0.8.5"
diff --git a/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock b/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock
index 0a2f222c2..2ae9e459e 100644
--- a/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock
+++ b/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.lock
@@ -1,5 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -38,14 +40,13 @@ checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]]
name = "rand"
-version = "0.8.3"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
"libc",
"rand_chacha",
"rand_core",
- "rand_hc",
]
[[package]]
@@ -68,15 +69,6 @@ dependencies = [
]
[[package]]
-name = "rand_hc"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
-dependencies = [
- "rand_core",
-]
-
-[[package]]
name = "wasi"
version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml b/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml
index 15b3fffca..d508e9578 100644
--- a/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml
+++ b/src/doc/book/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml
@@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2021"
[dependencies]
-rand = "0.8.3"
+rand = "0.8.5"