mirror of
https://github.com/maplibre/martin.git
synced 2024-12-21 05:41:55 +03:00
remove unneeded btree sorting (#970)
This commit is contained in:
parent
94f2c16267
commit
06da34c027
@ -3,7 +3,6 @@ use std::fmt::Debug;
|
||||
|
||||
use actix_web::error::ErrorNotFound;
|
||||
use async_trait::async_trait;
|
||||
use itertools::Itertools;
|
||||
use log::debug;
|
||||
use martin_tile_utils::TileInfo;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -38,7 +37,6 @@ impl TileSources {
|
||||
self.0
|
||||
.iter()
|
||||
.map(|(id, src)| (id.to_string(), src.get_catalog_entry()))
|
||||
.sorted_by(|(id1, _), (id2, _)| id1.cmp(id2))
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@ use std::fmt::Debug;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use futures::future::try_join_all;
|
||||
use itertools::Itertools;
|
||||
use log::{info, warn};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use spreet::fs::get_svg_input_paths;
|
||||
@ -93,7 +92,6 @@ impl SpriteSources {
|
||||
Ok(self
|
||||
.0
|
||||
.iter()
|
||||
.sorted_by(|(id1, _), (id2, _)| id1.cmp(id2))
|
||||
.map(|(id, source)| {
|
||||
let mut images = get_svg_input_paths(&source.path, true)
|
||||
.into_iter()
|
||||
|
@ -18,9 +18,7 @@ pub fn sorted_opt_map<S: Serializer, T: Serialize>(
|
||||
}
|
||||
|
||||
pub fn sorted_btree_map<K: Serialize + Ord, V>(value: &HashMap<K, V>) -> BTreeMap<&K, &V> {
|
||||
let mut items: Vec<(_, _)> = value.iter().collect();
|
||||
items.sort_by(|a, b| a.0.cmp(b.0));
|
||||
BTreeMap::from_iter(items)
|
||||
value.iter().collect()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
Loading…
Reference in New Issue
Block a user