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

pulibrary / bibdata / 630a66e1-fa84-4800-af5e-d518b6aca26b

19 Aug 2025 02:54PM UTC coverage: 92.221% (-0.02%) from 92.237%
630a66e1-fa84-4800-af5e-d518b6aca26b

Pull #2865

circleci

sandbergja
Rewrite scsb_doc? method in Rust

Co-authored-by: Christina Chortaria <christinach@users.noreply.github.com>
Pull Request #2865: Rewrite scsb_doc? method in Rust

0 of 11 new or added lines in 3 files covered. (0.0%)

7089 of 7687 relevant lines covered (92.22%)

422.39 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 is_scsb(record_string: String) -> Result<bool, magnus::Error> {
×
NEW
40
    let record = get_record(&record_string)?;
×
NEW
41
    Ok(scsb::is_scsb(&record))
×
NEW
42
}
×
43

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

52
pub fn strip_non_numeric(string: String) -> String {
×
53
    string_normalize::strip_non_numeric(&string)
×
54
}
×
55

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