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

divviup / divviup-api / 17722994826

15 Sep 2025 05:24AM UTC coverage: 55.879% (-0.04%) from 55.922%
17722994826

push

github

web-flow
Bump swagger-ui-react from 5.28.1 to 5.29.0 in /app (#1916)

Bumps [swagger-ui-react](https://github.com/swagger-api/swagger-ui) from 5.28.1 to 5.29.0.
- [Release notes](https://github.com/swagger-api/swagger-ui/releases)
- [Changelog](https://github.com/swagger-api/swagger-ui/blob/master/.releaserc)
- [Commits](https://github.com/swagger-api/swagger-ui/compare/v5.28.1...v5.29.0)

---
updated-dependencies:
- dependency-name: swagger-ui-react
  dependency-version: 5.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

3883 of 6949 relevant lines covered (55.88%)

60.27 hits per line

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

63.64
/src/entity/aggregator/role.rs
1
use rand::{distributions::Standard, prelude::Distribution};
2
use sea_orm::{DeriveActiveEnum, EnumIter};
3
use serde::{Deserialize, Serialize};
4
use std::{
5
    error::Error,
6
    fmt::{self, Display, Formatter},
7
    str::FromStr,
8
};
9

10
#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
11
#[sea_orm(rs_type = "i32", db_type = "Integer")]
12
pub enum Role {
13
    #[sea_orm(num_value = 0)]
14
    Leader,
15
    #[sea_orm(num_value = 1)]
16
    Helper,
17
    #[sea_orm(num_value = 2)]
18
    Either,
19
}
20

21
impl Distribution<Role> for Standard {
22
    fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> Role {
22✔
23
        match rng.gen_range(0..3) {
22✔
24
            0 => Role::Leader,
12✔
25
            1 => Role::Helper,
4✔
26
            _ => Role::Either,
6✔
27
        }
28
    }
22✔
29
}
30
impl AsRef<str> for Role {
31
    fn as_ref(&self) -> &str {
2✔
32
        match self {
2✔
33
            Self::Leader => "leader",
2✔
34
            Self::Helper => "helper",
×
35
            Self::Either => "either",
×
36
        }
37
    }
2✔
38
}
39

40
#[derive(Debug)]
41
pub struct UnrecognizedRole(String);
42
impl Display for UnrecognizedRole {
43
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
×
44
        f.write_fmt(format_args!("{} was not a recognized role option", self.0))
×
45
    }
×
46
}
47
impl Error for UnrecognizedRole {}
48
impl FromStr for Role {
49
    type Err = UnrecognizedRole;
50
    fn from_str(s: &str) -> Result<Self, Self::Err> {
2✔
51
        match &*s.to_lowercase() {
2✔
52
            "leader" => Ok(Self::Leader),
2✔
53
            "helper" => Ok(Self::Helper),
×
54
            "either" => Ok(Self::Either),
×
55
            unrecognized => Err(UnrecognizedRole(unrecognized.to_string())),
×
56
        }
57
    }
2✔
58
}
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