Skip to content

Commit

Permalink
removed unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Dec 13, 2024
1 parent 75ba553 commit be9634e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions martin/src/sprites/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ impl SpriteSources {
get_spritesheet(sprite_ids.iter(), dpi, as_sdf).await
}

fn get(&self, id: &str) -> SpriteResult<PathBuf> {
fn get(&self, id: &str) -> SpriteResult<SpriteSource> {
match self.0.get(id) {
Some(v) => Ok(v.path.clone()),
Some(v) => Ok(v.clone()),
None => Err(SpriteError::SpriteNotFound(id.to_string())),
}
}
Expand Down Expand Up @@ -200,18 +200,18 @@ async fn parse_sprite(
}

pub async fn get_spritesheet(
paths: impl Iterator<Item = &PathBuf>,
sources: impl Iterator<Item = &SpriteSource>,
pixel_ratio: u8,
as_sdf: bool,
) -> SpriteResult<Spritesheet> {
// Asynchronously load all SVG files from the given sources
let mut futures = Vec::new();
for source_path in paths {
let paths = get_svg_input_paths(source_path, true)
.map_err(|e| SpriteProcessingError(e, source_path.clone()))?;
for source in sources {
let paths = get_svg_input_paths(&source.path, true)
.map_err(|e| SpriteProcessingError(e, source.path.clone()))?;
for path in paths {
let name = sprite_name(&path, source_path)
.map_err(|e| SpriteProcessingError(e, source_path.clone()))?;
let name = sprite_name(&path, &source.path)
.map_err(|e| SpriteProcessingError(e, source.path.clone()))?;
futures.push(parse_sprite(name, path, pixel_ratio, as_sdf));
}
}
Expand Down
4 changes: 2 additions & 2 deletions martin/tests/pg_function_source_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ fn init() {
#[actix_rt::test]
async fn function_source_tilejson() {
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
let source = source(&mock, "function_zxy_query");
assert_yaml_snapshot!(source.get_tilejson(), @r###"
let tj = source(&mock, "function_zxy_query").get_tilejson();
assert_yaml_snapshot!(tj, @r###"
---
tilejson: 3.0.0
tiles: []
Expand Down
4 changes: 2 additions & 2 deletions martin/tests/pg_server_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,8 +1024,8 @@ tables:
let src = table(&mock, "no_id");
assert_eq!(src.id_column, None);
assert!(matches!(&src.properties, Some(v) if v.len() == 1));
let source = source(&mock, "no_id");
assert_yaml_snapshot!(source.get_tilejson(), @r###"
let tj = source(&mock, "no_id").get_tilejson();
assert_yaml_snapshot!(tj, @r###"
---
tilejson: 3.0.0
tiles: []
Expand Down
4 changes: 2 additions & 2 deletions martin/tests/pg_table_source_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ async fn table_source() {
#[actix_rt::test]
async fn tables_tilejson() {
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
let source = source(&mock, "table_source");
assert_yaml_snapshot!(source.get_tilejson(), @r###"
let tj = source(&mock, "table_source").get_tilejson();
assert_yaml_snapshot!(tj, @r###"
---
tilejson: 3.0.0
tiles: []
Expand Down

0 comments on commit be9634e

Please sign in to comment.