Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
samituga committed Sep 16, 2024
1 parent f73886a commit 9f008c7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
SQLX_VERSION: 0.7.1
SQLX_VERSION: 0.8
SQLX_FEATURES: "rustls,postgres"
DATABASE_URL: "postgres://postgres:password@localhost:5432/newsletter"
APP_AWS__ACCESS_KEY_ID: "dummy"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ push, pull_request ]

env:
CARGO_TERM_COLOR: always
SQLX_VERSION: 0.7.1
SQLX_VERSION: 0.8
SQLX_FEATURES: "rustls,postgres"
DATABASE_URL: "postgres://postgres:password@localhost:5432/newsletter"
APP_AWS__ACCESS_KEY_ID: "dummy"
Expand Down
12 changes: 6 additions & 6 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 @@ -2,7 +2,7 @@
name = "zero2prod"
version = "0.1.0"
edition = "2021"
rust-version = "1.78"
rust-version = "1.81"

[lib]
path = "src/lib.rs"
Expand Down Expand Up @@ -33,7 +33,7 @@ tracing-log = "0.2.0"
tracing-subscriber = { version = "0.3.18", features = ["registry", "env-filter"] }
unicode-segmentation = "1.11.0"
uuid = { version = "1.8.0", features = ["v4"] }
validator = "0.16.1"
validator = "0.18.0"

[dependencies.sqlx]
version = "0.7.4"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG CARGO_CHEF_IMAGE=lukemathwalker/cargo-chef:latest-rust-1.78.0
ARG CARGO_CHEF_IMAGE=lukemathwalker/cargo-chef:latest-rust-1.81.0
ARG RUNTIME_IMAGE=debian:bookworm-slim

FROM ${CARGO_CHEF_IMAGE} as chef
Expand Down
12 changes: 6 additions & 6 deletions infra/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ phases:
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $REPOSITORY_URI
- |
if ! aws ecr describe-images --repository-name $IMAGE_REPO_NAME --image-ids imageTag=latest-rust-1.78.0 --region $AWS_DEFAULT_REGION; then
if ! aws ecr describe-images --repository-name $IMAGE_REPO_NAME --image-ids imageTag=latest-rust-1.81.0 --region $AWS_DEFAULT_REGION; then
echo "Image not found in ECR, pulling from Docker Hub and pushing to ECR..."
docker pull lukemathwalker/cargo-chef:latest-rust-1.78.0
docker tag lukemathwalker/cargo-chef:latest-rust-1.78.0 $REPOSITORY_URI:latest-rust-1.78.0
docker push $REPOSITORY_URI:latest-rust-1.78.0
docker pull lukemathwalker/cargo-chef:latest-rust-1.81.0
docker tag lukemathwalker/cargo-chef:latest-rust-1.81.0 $REPOSITORY_URI:latest-rust-1.81.0
docker push $REPOSITORY_URI:latest-rust-1.81.0
else
echo "Image found in ECR."
fi
Expand All @@ -26,7 +26,7 @@ phases:
--progress=plain \
--target depbuilder \
--cache-from $REPOSITORY_URI:depbuilder \
--build-arg CARGO_CHEF_IMAGE=$REPOSITORY_URI:latest-rust-1.78.0 \
--build-arg CARGO_CHEF_IMAGE=$REPOSITORY_URI:latest-rust-1.81.0 \
--build-arg RUNTIME_IMAGE=public.ecr.aws/debian/debian:bookworm-slim \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--tag $IMAGE_REPO_NAME:depbuilder \
Expand All @@ -40,7 +40,7 @@ phases:
docker build \
--cache-from $REPOSITORY_URI:depbuilder \
--cache-from $REPOSITORY_URI:latest \
--build-arg CARGO_CHEF_IMAGE=$REPOSITORY_URI:latest-rust-1.78.0 \
--build-arg CARGO_CHEF_IMAGE=$REPOSITORY_URI:latest-rust-1.81.0 \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--progress=plain \
--tag $IMAGE_REPO_NAME:latest \
Expand Down
2 changes: 1 addition & 1 deletion scripts/init_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
if ! [ -x "$(command -v sqlx)" ]; then
echo >&2 "Error: sqlx is not installed."
echo >&2 "Use:"
echo >&2 " cargo install --version='~0.7' sqlx-cli \
echo >&2 " cargo install --version='~0.8' sqlx-cli \
--no-default-features --features rustls,postgres"
echo >&2 "to install it."
exit 1
Expand Down
4 changes: 2 additions & 2 deletions src/domain/subscriber_email.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use validator::validate_email;
use validator::ValidateEmail;

#[derive(Debug, PartialEq)]
pub struct SubscriberEmail(String);
impl SubscriberEmail {
pub fn parse(s: String) -> Result<SubscriberEmail, String> {
if validate_email(&s) {
if s.validate_email() {
Ok(Self(s))
} else {
Err(format!("{} is not a valid subscriber email.", s))
Expand Down

0 comments on commit 9f008c7

Please sign in to comment.