Skip to content

Commit

Permalink
deps: cargo update and some libs (8xFF#381)
Browse files Browse the repository at this point in the history
* deps: cargo update

* deps: update some libs

* fix clippys
  • Loading branch information
giangndm authored Jul 24, 2024
1 parent 776d87a commit d632c3f
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 125 deletions.
126 changes: 71 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ smallmap = "1.4"
derivative = "2.2"
derive_more = "0.99"
rand = "0.8"
mockall = "0.12"
prost = "0.12"
mockall = "0.13"
prost = "0.13"
indexmap = "2.2"
6 changes: 3 additions & 3 deletions packages/media_gateway/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl GatewayStore {
pub fn new(zone: u32, location: Location, max_cpu: u8, max_memory: u8, max_disk: u8) -> Self {
Self {
node: NodeMetrics::default(),
webrtc: ServiceStore::new(ServiceKind::Webrtc, location.clone()),
webrtc: ServiceStore::new(ServiceKind::Webrtc, location),
zone,
location,
output: None,
Expand All @@ -53,7 +53,7 @@ impl GatewayStore {
disk: self.node.disk,
origin: Origin::Gateway(GatewayOrigin {
zone: self.zone,
location: Some(self.location.clone()),
location: Some(self.location),
}),
webrtc: self.webrtc.local_stats(),
};
Expand Down Expand Up @@ -89,7 +89,7 @@ impl GatewayStore {

pub fn best_for(&self, kind: ServiceKind, location: Option<Location>) -> Option<u32> {
let node = match kind {
ServiceKind::Webrtc => self.webrtc.best_for(location.clone()),
ServiceKind::Webrtc => self.webrtc.best_for(location),
};
log::debug!("[GatewayStore] query best {:?} for {:?} got {:?}", kind, location, node);
node
Expand Down
2 changes: 1 addition & 1 deletion packages/media_gateway/src/store/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl ServiceStore {
}

pub fn best_for(&self, location: Option<Location>) -> Option<u32> {
let location = location.unwrap_or_else(|| self.location.clone());
let location = location.unwrap_or(self.location);
let mut min_dis = distance(&self.location, &location);
let mut min_node = self.local_sources.first().map(|s| s.node);

Expand Down
Loading

0 comments on commit d632c3f

Please sign in to comment.