mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 23:36:30 +00:00
Use push instead of extend_from_slice on chars
This commit is contained in:
parent
1c90575b9f
commit
3da860927d
3 changed files with 3 additions and 3 deletions
|
@ -42,7 +42,7 @@ bin = [\n",
|
|||
buf.extend_from_slice(b"\", path = \"../exercises/");
|
||||
if let Some(dir) = &exercise_info.dir {
|
||||
buf.extend_from_slice(dir.as_bytes());
|
||||
buf.extend_from_slice(b"/");
|
||||
buf.push(b'/');
|
||||
}
|
||||
buf.extend_from_slice(exercise_info.name.as_bytes());
|
||||
buf.extend_from_slice(b".rs\" },\n");
|
||||
|
|
|
@ -244,7 +244,7 @@ impl AppState {
|
|||
for exercise in &self.exercises {
|
||||
if exercise.done {
|
||||
self.file_buf.extend_from_slice(exercise.name.as_bytes());
|
||||
self.file_buf.extend_from_slice(b"\n");
|
||||
self.file_buf.push(b'\n');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ fn create_cargo_toml(exercise_infos: &[ExerciseInfo]) -> io::Result<()> {
|
|||
cargo_toml.extend_from_slice(b"\", path = \"exercises/");
|
||||
if let Some(dir) = &exercise_info.dir {
|
||||
cargo_toml.extend_from_slice(dir.as_bytes());
|
||||
cargo_toml.extend_from_slice(b"/");
|
||||
cargo_toml.push(b'/');
|
||||
}
|
||||
cargo_toml.extend_from_slice(exercise_info.name.as_bytes());
|
||||
cargo_toml.extend_from_slice(b".rs\" },\n");
|
||||
|
|
Loading…
Reference in a new issue