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

pulibrary / bibdata / 9e3d3f4e-43aa-4555-ad82-880a0c55d958

19 Aug 2025 01:23PM UTC coverage: 92.355% (+0.03%) from 92.327%
9e3d3f4e-43aa-4555-ad82-880a0c55d958

push

circleci

web-flow
Merge pull request #2863 from pulibrary/add-ephemera-genre-list

Add the rest of the genre list in the format_facet.rs mapping

58 of 62 new or added lines in 2 files covered. (93.55%)

1 existing line in 1 file now uncovered.

7091 of 7678 relevant lines covered (92.35%)

387.91 hits per line

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

75.0
/lib/bibdata_rs/src/ephemera/ephemera_folder/country.rs
1
use serde::{Deserialize, Deserializer};
2
use serde_json::Value;
3

4
#[derive(Clone, Debug)]
5
pub struct ExactMatch {
6
    pub id: String,
7
}
8

9
impl<'de> Deserialize<'de> for ExactMatch {
10
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
160✔
11
    where
160✔
12
        D: Deserializer<'de>,
160✔
13
    {
14
        let value = Value::deserialize(deserializer)?;
160✔
15
        if let Some(id) = value.get("@id") {
160✔
16
            if id.is_string() {
160✔
17
                return Ok(ExactMatch {
158✔
18
                    id: id.as_str().unwrap().to_string(),
158✔
19
                });
158✔
20
            }
2✔
21
            if id.is_object() {
2✔
22
                if let Some(nested_id) = id.get("@id") {
2✔
23
                    if nested_id.is_string() {
2✔
24
                        return Ok(ExactMatch {
2✔
25
                            id: nested_id.as_str().unwrap().to_string(),
2✔
26
                        });
2✔
27
                    }
×
28
                }
×
29
            }
×
30
        }
×
NEW
31
        Err(serde::de::Error::custom(
×
NEW
32
            "Could not parse ExactMatch Country id",
×
NEW
33
        ))
×
34
    }
160✔
35
}
36

37
impl ExactMatch {
38
    pub fn accepted_vocabulary(&self) -> bool {
235✔
39
        self.id
235✔
40
            .starts_with("http://id.loc.gov/vocabulary/countries/")
235✔
41
    }
235✔
42
}
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