Skip to content

Commit 7de319d

Browse files
committed
WIP
1 parent 3cc31dc commit 7de319d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/uu/head/src/take.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn copy_all_but_bytes(
7777
let mut buffers: VecDeque<TakeAllBuffer> = VecDeque::new();
7878
let mut empty_buffer_pool: Vec<TakeAllBuffer> = vec![];
7979
let mut buffered_bytes: usize = 0;
80-
let mut total_bytes_coppied = 0;
80+
let mut total_bytes_copied = 0;
8181
loop {
8282
loop {
8383
// Try to buffer at least enough to write the entire first buffer.
@@ -107,13 +107,13 @@ pub fn copy_all_but_bytes(
107107
let front_buffer = buffers.front_mut().unwrap();
108108
let bytes_written = front_buffer.write_bytes_limit(writer, excess_buffered_bytes)?;
109109
buffered_bytes -= bytes_written;
110-
total_bytes_coppied += bytes_written;
110+
total_bytes_copied += bytes_written;
111111
// If the front buffer is empty (which it probably is), push it into the empty-buffer-pool.
112112
if front_buffer.is_empty() {
113113
empty_buffer_pool.push(buffers.pop_front().unwrap());
114114
}
115115
}
116-
Ok(total_bytes_coppied)
116+
Ok(total_bytes_copied)
117117
}
118118

119119
struct TakeAllLinesBuffer {
@@ -209,11 +209,11 @@ pub fn copy_all_but_lines<R: Read, W: Write>(
209209
let mut buffers: VecDeque<TakeAllLinesBuffer> = VecDeque::new();
210210
let mut buffered_lines: usize = 0;
211211
let mut empty_buffers = vec![];
212-
let mut total_bytes_coppied = 0;
212+
let mut total_bytes_copied = 0;
213213
loop {
214214
// Try to buffer enough such that we can write out the entire first buffer.
215215
loop {
216-
// First check if we have enough lines buffered that we can write out the entier
216+
// First check if we have enough lines buffered that we can write out the entire
217217
// front buffer. If so, break.
218218
let front_buffer = buffers.front();
219219
if let Some(front_buffer) = front_buffer {
@@ -237,18 +237,18 @@ pub fn copy_all_but_lines<R: Read, W: Write>(
237237
break;
238238
}
239239

240-
// Since we have some data buffered, can assume we have at least 1 bufffer.
240+
// Since we have some data buffered, can assume we have at least 1 buffer.
241241
let front_buffer = buffers.front_mut().unwrap();
242242
let excess_buffered_lines = buffered_lines - n;
243243
let write_result = front_buffer.write_lines(writer, excess_buffered_lines, separator)?;
244244
buffered_lines -= write_result.lines;
245-
total_bytes_coppied += write_result.bytes;
245+
total_bytes_copied += write_result.bytes;
246246
// If the front buffer is empty (which it probably is), push it into the empty-buffer-pool.
247247
if front_buffer.is_empty() {
248248
empty_buffers.push(buffers.pop_front().unwrap());
249249
}
250250
}
251-
Ok(total_bytes_coppied)
251+
Ok(total_bytes_copied)
252252
}
253253

254254
/// Like `std::io::Take`, but for lines instead of bytes.

0 commit comments

Comments
 (0)