@@ -177,27 +177,25 @@ assert_eq!(lines[1].as_str(), "This is a test.");
177177##### Common IO operations
178178
179179``` rust
180- fn main () {
181- let to_read_file = " https://spaces.bgpkit.org/oneio/test_data.txt.gz" ;
182- let to_write_file = " /tmp/test_write.txt.bz2" ;
183-
184- // read text from remote gzip file
185- let mut text = "" . to_string ();
186- oneio :: get_reader (to_read_file ). unwrap (). read_to_string (& mut text ). unwrap ();
187-
188- // write the same text to a local bz2 file
189- let mut writer = oneio :: get_writer (to_write_file ). unwrap ();
190- writer . write_all (text . as_ref ()). unwrap ();
191- drop (writer );
192-
193- // read from the newly generated bz2 file
194- let mut new_text = "" . to_string ();
195- oneio :: get_reader (to_write_file ). unwrap (). read_to_string (& mut new_text ). unwrap ();
196-
197- // compare the decompressed content of the remote and local files
198- assert_eq! (text . as_str (), new_text . as_str ());
199- std :: fs :: remove_file (to_write_file ). unwrap ();
200- }
180+ let to_read_file = " https://spaces.bgpkit.org/oneio/test_data.txt.gz" ;
181+ let to_write_file = " /tmp/test_write.txt.bz2" ;
182+
183+ // read text from remote gzip file
184+ let mut text = "" . to_string ();
185+ oneio :: get_reader (to_read_file ). unwrap (). read_to_string (& mut text ). unwrap ();
186+
187+ // write the same text to a local bz2 file
188+ let mut writer = oneio :: get_writer (to_write_file ). unwrap ();
189+ writer . write_all (text . as_ref ()). unwrap ();
190+ drop (writer );
191+
192+ // read from the newly generated bz2 file
193+ let mut new_text = "" . to_string ();
194+ oneio :: get_reader (to_write_file ). unwrap (). read_to_string (& mut new_text ). unwrap ();
195+
196+ // compare the decompressed content of the remote and local files
197+ assert_eq! (text . as_str (), new_text . as_str ());
198+ std :: fs :: remove_file (to_write_file ). unwrap ();
201199```
202200
203201##### Read remote content with custom headers
0 commit comments