better naming: str --> string

Suggested by @notoria in #589. Many thanks!
This commit is contained in:
Markus Triska
2020-06-12 20:54:30 +02:00
parent b85ff7db36
commit 5f1b03261c

View File

@@ -2274,8 +2274,7 @@ impl MachineState {
_ => { unreachable!() } _ => { unreachable!() }
}; };
let chars = { let mut string = String::new();
let mut str = String::new();
if stream.options.stream_type == StreamType::Binary { if stream.options.stream_type == StreamType::Binary {
let mut mstream = stream.clone(); let mut mstream = stream.clone();
@@ -2284,7 +2283,7 @@ impl MachineState {
match mstream.read(&mut b) { match mstream.read(&mut b) {
Ok(1) => { Ok(1) => {
str.push(b[0] as char); string.push(b[0] as char);
} }
_ => { _ => {
break; break;
@@ -2302,17 +2301,15 @@ impl MachineState {
match result { match result {
Some(Ok(c)) => { Some(Ok(c)) => {
str.push(c); string.push(c);
} }
_ => { break; _ => { break;
} }
} }
} }
}
str
}; };
let str = self.heap.put_complete_string(&chars); let string = self.heap.put_complete_string(&string);
self.unify(self[temp_v!(3)], str); self.unify(self[temp_v!(3)], string);
} }
&SystemClauseType::GetCode => { &SystemClauseType::GetCode => {
let mut stream = let mut stream =