Upgrade js_int to 0.1.5

master
Jonas Platte 2020-04-27 12:12:45 +02:00
parent 4858ca5f74
commit 5cfac42101
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
3 changed files with 13 additions and 15 deletions

View File

@ -23,7 +23,7 @@ url = "2.1.1"
async-trait = "0.1.30"
# Ruma dependencies
js_int = "0.1.4"
js_int = "0.1.5"
ruma-api = "0.16.0-rc.2"
ruma-client-api = { version = "0.8.0-rc.5" }
ruma-events = { version = "0.21.0-beta.1" }

View File

@ -147,13 +147,13 @@ impl RoomName {
} else if !self.aliases.is_empty() && !self.aliases[0].alias().is_empty() {
self.aliases[0].alias().trim().to_string()
} else {
let joined = self.joined_member_count.unwrap_or(UInt::min_value());
let invited = self.invited_member_count.unwrap_or(UInt::min_value());
let joined = self.joined_member_count.unwrap_or(UInt::MIN);
let invited = self.invited_member_count.unwrap_or(UInt::MIN);
let heroes = UInt::new(self.heroes.len() as u64).unwrap();
let one = UInt::new(1).unwrap();
let invited_joined = if invited + joined == UInt::min_value() {
UInt::min_value()
let invited_joined = if invited + joined == UInt::MIN {
UInt::MIN
} else {
invited + joined - one
};

View File

@ -326,17 +326,15 @@ mod test {
.invite_3pid(vec![])
.is_direct(true)
.power_level_override(PowerLevelsEventContent {
ban: Int::max_value(),
ban: Int::MAX,
events: BTreeMap::default(),
events_default: Int::min_value(),
invite: Int::min_value(),
kick: Int::min_value(),
redact: Int::max_value(),
state_default: Int::min_value(),
users_default: Int::min_value(),
notifications: NotificationPowerLevels {
room: Int::min_value(),
},
events_default: Int::MIN,
invite: Int::MIN,
kick: Int::MIN,
redact: Int::MAX,
state_default: Int::MIN,
users_default: Int::MIN,
notifications: NotificationPowerLevels { room: Int::MIN },
users: BTreeMap::default(),
})
.preset(RoomPreset::PrivateChat)