Skip to content

Commit

Permalink
Merge pull request #250 from everx-labs/IgorKoval/fix-pushslice
Browse files Browse the repository at this point in the history
Fix `parse_slice`
  • Loading branch information
tonjen authored Jul 1, 2024
1 parent 82ef6cc commit a663b51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## Version 1.6.3

- fix `parse_slice`


## Version 1.6.1

- Use modern crates anyhow and thiserror instead of failure
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build = 'build.rs'
edition = '2021'
name = 'ever_assembler'
version = '1.6.2'
version = '1.6.3'

[dependencies]
anyhow = '1.0'
Expand Down
5 changes: 1 addition & 4 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,7 @@ pub(super) fn parse_register(
}

pub fn parse_slice(slice: &str, bits: usize) -> Result<Vec<u8>, ParameterError> {
if slice.len() <= 1 {
log::error!(target: "compile", "empty string");
Err(ParameterError::UnexpectedType)
} else if slice.chars().next().unwrap().to_ascii_uppercase() != 'X' {
if slice.chars().next().unwrap().to_ascii_uppercase() != 'X' {
log::error!(target: "compile", "base not set");
Err(ParameterError::UnexpectedType)
} else {
Expand Down

0 comments on commit a663b51

Please sign in to comment.