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" async-trait = "0.1.30"
# Ruma dependencies # Ruma dependencies
js_int = "0.1.4" js_int = "0.1.5"
ruma-api = "0.16.0-rc.2" ruma-api = "0.16.0-rc.2"
ruma-client-api = { version = "0.8.0-rc.5" } ruma-client-api = { version = "0.8.0-rc.5" }
ruma-events = { version = "0.21.0-beta.1" } 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() { } else if !self.aliases.is_empty() && !self.aliases[0].alias().is_empty() {
self.aliases[0].alias().trim().to_string() self.aliases[0].alias().trim().to_string()
} else { } else {
let joined = self.joined_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_value()); let invited = self.invited_member_count.unwrap_or(UInt::MIN);
let heroes = UInt::new(self.heroes.len() as u64).unwrap(); let heroes = UInt::new(self.heroes.len() as u64).unwrap();
let one = UInt::new(1).unwrap(); let one = UInt::new(1).unwrap();
let invited_joined = if invited + joined == UInt::min_value() { let invited_joined = if invited + joined == UInt::MIN {
UInt::min_value() UInt::MIN
} else { } else {
invited + joined - one invited + joined - one
}; };

View File

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