• 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

79.17
/lib/bibdata_rs/src/marc/scsb/collection_group.rs
1
use std::str::FromStr;
2

3
use marctk::Record;
4

5
pub enum CollectionGroup {
6
    Shared,
7
    Private,
8
    Committed,
9
    Uncommittable,
10
    Open,
11
}
12

13
impl CollectionGroup {
14
    pub fn code(&self) -> char {
1✔
15
        match self {
1✔
NEW
16
            Self::Committed => 'C',
×
17
            Self::Open => 'O',
1✔
NEW
18
            Self::Private => 'P',
×
NEW
19
            Self::Shared => 'S',
×
NEW
20
            Self::Uncommittable => 'U',
×
21
        }
22
    }
1✔
23
}
24

25
pub fn collection_groups(record: &Record) -> Vec<CollectionGroup> {
1✔
26
    record
1✔
27
        .get_field_values("876", "x")
1✔
28
        .iter()
1✔
29
        .filter_map(|value| CollectionGroup::from_str(value).ok())
1✔
30
        .collect()
1✔
31
}
1✔
32

33
pub struct NoSuchCollectionGroup;
34
impl FromStr for CollectionGroup {
35
    type Err = NoSuchCollectionGroup;
36

37
    fn from_str(s: &str) -> Result<Self, Self::Err> {
1✔
38
        match s {
1✔
39
            "Shared" => Ok(Self::Shared),
1✔
40
            "Private" => Ok(Self::Private),
1✔
41
            "Committed" => Ok(Self::Committed),
1✔
42
            "Uncommittable" => Ok(Self::Uncommittable),
1✔
43
            "Open" => Ok(Self::Open),
1✔
NEW
44
            _ => Err(NoSuchCollectionGroup),
×
45
        }
46
    }
1✔
47
}
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