Simplify environment variable examples · model-checking/verify-rust-std@ce29159 (original) (raw)

Original file line number Diff line number Diff line change
@@ -120,11 +120,8 @@ pub struct VarsOs {
120 120 /// # Examples
121 121 ///
122 122 /// ```
123 -/// use std::env;
124 -///
125 -/// // We will iterate through the references to the element returned by
126 -/// // env::vars();
127 -/// for (key, value) in env::vars() {
123 +/// // Print all environment variables.
124 +/// for (key, value) in std::env::vars() {
128 125 /// println!("{key}: {value}");
129 126 /// }
130 127 /// ```
@@ -150,11 +147,8 @@ pub fn vars() -> Vars {
150 147 /// # Examples
151 148 ///
152 149 /// ```
153 -/// use std::env;
154 -///
155 -/// // We will iterate through the references to the element returned by
156 -/// // env::vars_os();
157 -/// for (key, value) in env::vars_os() {
150 +/// // Print all environment variables.
151 +/// for (key, value) in std::env::vars_os() {
158 152 /// println!("{key:?}: {value:?}");
159 153 /// }
160 154 /// ```