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

pulibrary / bibdata / 7fbdb612-9763-4164-8c1a-8911fcff1c33

19 Aug 2025 04:07PM UTC coverage: 92.112% (+0.1%) from 91.991%
7fbdb612-9763-4164-8c1a-8911fcff1c33

push

circleci

web-flow
Merge pull request #2866 from pulibrary/scsb-doc-2

Migrate recap_notes_display to Rust

72 of 91 new or added lines in 4 files covered. (79.12%)

7135 of 7746 relevant lines covered (92.11%)

379.67 hits per line

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

0.0
/lib/bibdata_rs/src/marc.rs
1
use magnus::exception;
2
use marctk::Record;
3

4
mod string_normalize;
5

6
pub mod control_field;
7
pub mod fixed_field;
8
pub mod genre;
9
pub mod language;
10
pub mod note;
11
pub mod record_facet_mapping;
12
pub mod scsb;
13

14
pub use string_normalize::trim_punctuation;
15

16
pub fn alma_code_start_22(code: String) -> bool {
×
17
    code.starts_with("22") && code.ends_with("06421")
×
18
}
×
19
pub fn genres(record_string: String) -> Result<Vec<String>, magnus::Error> {
×
20
    let record = get_record(&record_string)?;
×
21
    Ok(genre::genres(&record))
×
22
}
×
23

24
pub fn original_languages_of_translation(
×
25
    record_string: String,
×
26
) -> Result<Vec<String>, magnus::Error> {
×
27
    let record = get_record(&record_string)?;
×
28
    Ok(language::original_languages_of_translation(&record)
×
29
        .iter()
×
30
        .map(|language| language.english_name.to_owned())
×
31
        .collect())
×
32
}
×
33

34
pub fn access_notes(record_string: String) -> Result<Option<Vec<String>>, magnus::Error> {
×
35
    let record = get_record(&record_string)?;
×
36
    Ok(note::access_notes(&record))
×
37
}
×
38

NEW
39
pub fn recap_partner_notes(record_string: String) -> Result<Vec<String>, magnus::Error> {
×
NEW
40
    let record = get_record(&record_string)?;
×
NEW
41
    Ok(scsb::recap_partner::recap_partner_notes(&record))
×
NEW
42
}
×
43

44
pub fn is_scsb(record_string: String) -> Result<bool, magnus::Error> {
×
45
    let record = get_record(&record_string)?;
×
46
    Ok(scsb::is_scsb(&record))
×
47
}
×
48

49
pub fn format_facets(record_string: String) -> Result<Vec<String>, magnus::Error> {
×
50
    let record = get_record(&record_string)?;
×
51
    Ok(record_facet_mapping::format_facets(&record)
×
52
        .iter()
×
53
        .map(|facet| format!("{facet}"))
×
54
        .collect())
×
55
}
×
56

57
pub fn strip_non_numeric(string: String) -> String {
×
58
    string_normalize::strip_non_numeric(&string)
×
59
}
×
60

61
fn get_record(breaker: &str) -> Result<Record, magnus::Error> {
×
62
    Record::from_breaker(breaker).map_err(|err| {
×
63
        magnus::Error::new(
×
64
            exception::runtime_error(),
×
65
            format!("Found error {} while parsing breaker {}", err, breaker),
×
66
        )
67
    })
×
68
}
×
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