To skip the first argument (which is always the name of the program itself), you could use the following : for filename in std::env::args().skip(1) { println!("{filename}"); }
Great tutorial! Is there any way to load the file in chunks ? If I am reading a very large file, reading it into a string may not be a good idea. If we reading it in chunks, we have to be careful about the boundaries, it should not cut off Unicode character in half (first byte in chunk 1 and second byte in chunk 2 is bad). Thanks!
To skip the first argument (which is always the name of the program itself), you could use the following :
for filename in std::env::args().skip(1) {
println!("{filename}");
}
nice
thanks, added to the plans
Great tutorial! Is there any way to load the file in chunks ? If I am reading a very large file, reading it into a string may not be a good idea. If we reading it in chunks, we have to be careful about the boundaries, it should not cut off Unicode character in half (first byte in chunk 1 and second byte in chunk 2 is bad). Thanks!
That's a good extension to the exercise. Please open an issue on the GitHub repository with this idea so I'll be able to address it in the next video.
Gabor, it doesn't make sense to `.collect().len()` an Iterator. Just `.count()` it.
hi, where to find the
code ?
Link to code added to the page about the video rust.code-maven.com/implementing-wc-in-rust