Skip to content

Commit

Permalink
code quality = none
Browse files Browse the repository at this point in the history
  • Loading branch information
geremachek committed Jul 14, 2021
1 parent e11536f commit fb87b4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/plane/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ impl Plane {
cvol.set_written(false);

match command {
Command::Inscribe => cvol.inscribe(data.remove(0)),
Command::Trample => cvol.trample(data.remove(0)),
Command::Inscribe => cvol.inscribe(&data[0]),
Command::Trample => cvol.trample(&data[0]),
Command::Burn => cvol.burn(),
Command::Shave => cvol.shave(parse_pos::<usize>(&data[0])?),
_ => (),
Expand Down
6 changes: 3 additions & 3 deletions src/volume/vol_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Volume {

// inset some text into the buffer

pub fn inscribe(&mut self, s: String) {
pub fn inscribe(&mut self, s: &str) {
if !s.is_empty() {
let mut lines = s.lines();

Expand All @@ -95,9 +95,9 @@ impl Volume {

// overwrite text

pub fn trample(&mut self, s: String) {
pub fn trample(&mut self, s: &str) {
if s.is_empty() {
self.buffer[self.line] = s;
self.buffer[self.line].clear();
} else {
for (i, line) in s.lines().enumerate() {
if self.line + i >= self.buffer.len() { // the length of the piece of text excedes the length of the buffer
Expand Down

0 comments on commit fb87b4c

Please sign in to comment.