Skip to content

Commit

Permalink
Small fix in mmCIF files parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
douweschulte committed Jun 12, 2024
1 parent c326905 commit a21b17c
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/read/mmcif/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,22 +558,15 @@ fn parse_atoms(input: &Loop, pdb: &mut PDB) -> Option<Vec<PDBError>> {
/// Get the Textual content of the value, if available
fn get_text(
value: &Value,
context: &Context,
column: Option<&str>,
_context: &Context,
_column: Option<&str>,
) -> Result<Option<String>, PDBError> {
match value {
Value::Text(t) => Ok(Some(t.to_string())),
Value::Inapplicable => Ok(None),
Value::Unknown => Ok(None),
Value::Numeric(n) => Ok(Some(format!("{n}"))),
_ => Err(PDBError::new(
ErrorLevel::InvalidatingError,
"Not text",
column.map_or(String::new(), |v| {
format!("The '{v}' column should contain text.")
}),
context.clone(),
)),
Value::NumericWithUncertainty(n, u) => Ok(Some(format!("{n}({u})"))),
}
}

Expand Down

0 comments on commit a21b17c

Please sign in to comment.