Skip to content

Conversation

tcyrus
Copy link

@tcyrus tcyrus commented Mar 7, 2020

  • Use trim_start_matches instead of while loop
  • Use match statements in src/flash.rc
  • Replace writeln!(stderr(), ...) with eprintln!(...)

@tcyrus
Copy link
Author

tcyrus commented Feb 26, 2021

@jackpot51 Sorry for poking you, but I'm currently going through old forks and addressing stale PR's.
Is there anything preventing this PR from being merged?

@jackpot51
Copy link
Member

Please try to compile this.

@tcyrus
Copy link
Author

tcyrus commented Feb 27, 2021

Sorry about that. I believe that I've fixed the cargo build issues.

}
version
let version = unsafe { self.get_str(b"VER:") };
String::from(version.trim_start_matches(' '))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allocates twice, compared to the original code which only allocates a string once, then shifts the bytes around as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants