• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / bibdata / 880759a6-1cd8-4c26-ac18-7fa2f37cee33

14 Aug 2025 04:24PM UTC coverage: 92.642% (+0.02%) from 92.625%
880759a6-1cd8-4c26-ac18-7fa2f37cee33

Pull #2849

circleci

sandbergja
Rename module for clarity

Co-authored-by: Christina Chortaria <christinach@users.noreply.github.com>
Pull Request #2849: Refactor format facet code to Rust

325 of 361 new or added lines in 8 files covered. (90.03%)

5 existing lines in 1 file now uncovered.

6988 of 7543 relevant lines covered (92.64%)

429.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.47
/lib/bibdata_rs/src/marc/control_field/system_control_number.rs
1
// This module is concerned with the 035 (system control number)
2

3
use marctk::Record;
4

5
pub enum SystemControlNumber {
6
    Pulfa(String),
7
    OtherControlNumber,
8
    InvalidControlNumber,
9
}
10

11
impl From<&str> for SystemControlNumber {
12
    fn from(value: &str) -> Self {
10✔
13
        if value.starts_with("(PULFA)") {
10✔
14
            match value.split(')').next_back() {
10✔
15
                Some(number) => SystemControlNumber::Pulfa(number.to_owned()),
10✔
NEW
16
                None => SystemControlNumber::InvalidControlNumber,
×
17
            }
18
        } else {
NEW
19
            SystemControlNumber::OtherControlNumber
×
20
        }
21
    }
10✔
22
}
23

24
pub fn system_control_numbers(record: &Record) -> Vec<SystemControlNumber> {
11✔
25
    record
11✔
26
        .extract_values("035a")
11✔
27
        .iter()
11✔
28
        .map(|value| SystemControlNumber::from(value.as_str()))
11✔
29
        .collect()
11✔
30
}
11✔
31

32
pub fn is_princeton_finding_aid(record: &Record) -> bool {
11✔
33
    system_control_numbers(record)
11✔
34
        .iter()
11✔
35
        .any(|number| matches!(number, SystemControlNumber::Pulfa(_)))
11✔
36
}
11✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc