Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Jul 23, 2024
1 parent 78e619e commit 9b01bf4
Show file tree
Hide file tree
Showing 16 changed files with 167 additions and 182 deletions.
247 changes: 120 additions & 127 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ size_format = "1.0.2"
spreet = { version = "0.11", default-features = false }
sqlite-compressions = { version = "0.2.12", default-features = false, features = ["bsdiffraw", "gzip"] }
sqlite-hashes = { version = "0.7.3", default-features = false, features = ["md5", "aggregate", "hex"] }
sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] }
sqlx = { version = "0.8", features = ["sqlite", "runtime-tokio"] }
static-files = "0.2"
subst = { version = "0.3", features = ["yaml"] }
thiserror = "1"
Expand Down
5 changes: 5 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ clean-martin-ui:
clean-test:
rm -rf tests/output

# Update dependencies, including breaking changes
update:
cargo +nightly -Z unstable-options update --breaking
cargo update

# Start a test database
start: (docker-up "db") docker-is-ready

Expand Down
14 changes: 7 additions & 7 deletions martin/src/srv/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ use std::pin::Pin;
use std::string::ToString;
use std::time::Duration;

use crate::config::ServerState;
use crate::source::TileCatalog;
use crate::srv::config::{SrvConfig, KEEP_ALIVE_DEFAULT, LISTEN_ADDRESSES_DEFAULT};
use crate::srv::tiles::get_tile;
use crate::srv::tiles_info::get_source_info;
use crate::MartinError::BindingError;
use crate::MartinResult;
use actix_cors::Cors;
use actix_web::error::ErrorInternalServerError;
use actix_web::http::header::CACHE_CONTROL;
Expand All @@ -24,6 +17,13 @@ use serde::{Deserialize, Serialize};

#[cfg(feature = "webui")]
use crate::args::WebUiMode;
use crate::config::ServerState;
use crate::source::TileCatalog;
use crate::srv::config::{SrvConfig, KEEP_ALIVE_DEFAULT, LISTEN_ADDRESSES_DEFAULT};
use crate::srv::tiles::get_tile;
use crate::srv::tiles_info::get_source_info;
use crate::MartinError::BindingError;
use crate::MartinResult;

#[cfg(feature = "webui")]
mod webui {
Expand Down

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

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

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

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

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

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

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

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

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

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

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

29 changes: 8 additions & 21 deletions mbtiles/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ where
) AS is_valid;"
);

Ok(sql
.fetch_one(&mut *conn)
.await?
.is_valid
.unwrap_or_default()
== 1)
Ok(sql.fetch_one(&mut *conn).await?.is_valid == 1)
}

/// Check if `MBTiles` has a table or a view named `tiles_with_hash` with needed fields
Expand All @@ -90,12 +85,7 @@ where
) as is_valid;"
);

Ok(sql
.fetch_one(&mut *conn)
.await?
.is_valid
.unwrap_or_default()
== 1)
Ok(sql.fetch_one(&mut *conn).await?.is_valid == 1)
}

pub async fn is_flat_with_hash_tables_type<T>(conn: &mut T) -> MbtResult<bool>
Expand All @@ -115,7 +105,7 @@ where

let is_valid = sql.fetch_one(&mut *conn).await?.is_valid;

Ok(is_valid.unwrap_or_default() == 1 && has_tiles_with_hash(&mut *conn).await?)
Ok(is_valid == 1 && has_tiles_with_hash(&mut *conn).await?)
}

pub async fn is_flat_tables_type<T>(conn: &mut T) -> MbtResult<bool>
Expand Down Expand Up @@ -144,12 +134,7 @@ where
) as is_valid;"
);

Ok(sql
.fetch_one(&mut *conn)
.await?
.is_valid
.unwrap_or_default()
== 1)
Ok(sql.fetch_one(&mut *conn).await?.is_valid == 1)
}

pub async fn create_metadata_table<T>(conn: &mut T) -> MbtResult<()>
Expand Down Expand Up @@ -409,8 +394,10 @@ FROM tiles;"
.fetch_one(conn)
.await?;

let min_zoom = validate_zoom(info.min_zoom, "zoom_level")?;
let max_zoom = validate_zoom(info.max_zoom, "zoom_level")?;
#[allow(clippy::cast_possible_truncation)]
let min_zoom = validate_zoom(info.min_zoom.map(|v| v as i32), "zoom_level")?;
#[allow(clippy::cast_possible_truncation)]
let max_zoom = validate_zoom(info.max_zoom.map(|v| v as i32), "zoom_level")?;

match (min_zoom, max_zoom) {
(Some(min_zoom), Some(max_zoom)) => Ok(Some((min_zoom, max_zoom))),
Expand Down

0 comments on commit 9b01bf4

Please sign in to comment.