Skip to content

Commit

Permalink
fix(read-opts): add back level parameter to read functions
Browse files Browse the repository at this point in the history
Since the functions are to be deprecated, we don't want to change their public API for compatibility.
  • Loading branch information
y1zhou committed May 31, 2024
1 parent 8b97396 commit e82ec7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/read/mmcif/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ use std::io::prelude::*;
since = "0.12.0",
note = "Please use `ReadOptions::default().set_format(Format::Mmcif).read(filename)` instead"
)]
pub fn open_mmcif(filename: impl AsRef<str>) -> Result<(PDB, Vec<PDBError>), Vec<PDBError>> {
open_mmcif_with_options(filename, &ReadOptions::default())
pub fn open_mmcif(
filename: impl AsRef<str>,
level: StrictnessLevel,
) -> Result<(PDB, Vec<PDBError>), Vec<PDBError>> {
open_mmcif_with_options(filename, ReadOptions::default().set_level(level))
}

/// Parse the given mmCIF file into a PDB struct with [`ReadOptions`].
Expand Down
7 changes: 5 additions & 2 deletions src/read/pdb/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ use super::validate::*;
since = "0.12.0",
note = "Please use `ReadOptions::default().set_format(Format::Pdb).read(filename)` instead"
)]
pub fn open_pdb(filename: impl AsRef<str>) -> Result<(PDB, Vec<PDBError>), Vec<PDBError>> {
open_pdb_with_options(filename, &ReadOptions::default())
pub fn open_pdb(
filename: impl AsRef<str>,
level: StrictnessLevel,
) -> Result<(PDB, Vec<PDBError>), Vec<PDBError>> {
open_pdb_with_options(filename, ReadOptions::default().set_level(level))
}

/// Parse the given file into a PDB struct with [`ReadOptions`].
Expand Down

0 comments on commit e82ec7f

Please sign in to comment.