Skip to content

fix(ci): cut run-integration-test.yml over to "mlugg/setup-zig@v2", clippy fixes #1005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/run-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
repo: cargo-lambda/cargo-lambda
platform: linux
arch: x86_64
# TODO: unpin once https://github.com/cargo-lambda/cargo-lambda/issues/856 is fixed
# TODO: unpin once https://github.com/awslabs/aws-lambda-rust-runtime/issues/1006 is fixed
tag: v1.8.1
- name: install Zig toolchain
uses: korandoru/setup-zig@v1
uses: mlugg/setup-zig@v2
with:
zig-version: 0.10.0
version: 0.10.0
- name: install SAM
uses: aws-actions/setup-sam@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions lambda-events/src/custom_serde/codebuild_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ impl Visitor<'_> for TimeVisitor {
type Value = DateTime<Utc>;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(formatter, "valid codebuild time: {}", CODEBUILD_TIME_FORMAT)
write!(formatter, "valid codebuild time: {CODEBUILD_TIME_FORMAT}")
}

fn visit_str<E: DeError>(self, val: &str) -> Result<Self::Value, E> {
NaiveDateTime::parse_from_str(val, CODEBUILD_TIME_FORMAT)
.map(|naive| naive.and_utc())
.map_err(|e| DeError::custom(format!("Parse error {} for {}", e, val)))
.map_err(|e| DeError::custom(format!("Parse error {e} for {val}")))
}
}

Expand Down
7 changes: 3 additions & 4 deletions lambda-events/src/custom_serde/float_unix_epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,23 @@ fn ne_timestamp<T: fmt::Display>(ts: T) -> SerdeError<T, u8> {

impl<V: fmt::Display, D: fmt::Display> fmt::Debug for SerdeError<V, D> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "ChronoSerdeError({})", self)
write!(f, "ChronoSerdeError({self})")
}
}

impl<V: fmt::Display, D: fmt::Display> fmt::Display for SerdeError<V, D> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
SerdeError::NonExistent { ref timestamp } => {
write!(f, "value is not a legal timestamp: {}", timestamp)
write!(f, "value is not a legal timestamp: {timestamp}")
}
SerdeError::Ambiguous {
ref timestamp,
ref min,
ref max,
} => write!(
f,
"value is an ambiguous timestamp: {}, could be either of {}, {}",
timestamp, min, max
"value is an ambiguous timestamp: {timestamp}, could be either of {min}, {max}",
),
}
}
Expand Down
8 changes: 4 additions & 4 deletions lambda-events/src/encodings/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ where
let whole_seconds = seconds + (milliseconds as i64 / 1000);
let subsec_millis = milliseconds % 1000;
if milliseconds > 0 {
let combined = format!("{}.{:03}", whole_seconds, subsec_millis);
let combined = format!("{whole_seconds}.{subsec_millis:03}");
serializer.serialize_str(&combined)
} else {
serializer.serialize_str(&whole_seconds.to_string())
Expand Down Expand Up @@ -159,7 +159,7 @@ where
{
let seconds = f64::deserialize(deserializer)?;
TimeDelta::try_seconds(seconds as i64)
.ok_or_else(|| D::Error::custom(format!("invalid time delta seconds `{}`", seconds)))
.ok_or_else(|| D::Error::custom(format!("invalid time delta seconds `{seconds}`")))
}

fn serialize_duration_minutes<S>(duration: &TimeDelta, serializer: S) -> Result<S::Ok, S::Error>
Expand All @@ -177,7 +177,7 @@ where
{
let minutes = f64::deserialize(deserializer)?;
TimeDelta::try_minutes(minutes as i64)
.ok_or_else(|| D::Error::custom(format!("invalid time delta minutes `{}`", minutes)))
.ok_or_else(|| D::Error::custom(format!("invalid time delta minutes `{minutes}`")))
}

fn normalize_timestamp<'de, D>(deserializer: D) -> Result<(u64, u64), D::Error>
Expand All @@ -199,7 +199,7 @@ where
};

// We need to do this due to floating point issues.
let input_as_string = format!("{}", input);
let input_as_string = input.to_string();
let parts: Result<Vec<u64>, _> = input_as_string
.split('.')
.map(|x| x.parse::<u64>().map_err(DeError::custom))
Expand Down
2 changes: 1 addition & 1 deletion lambda-events/src/event/cloudwatch_alarms/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl Serialize for CloudWatchAlarmStateReasonData {
Self::Composite(m) => serde_json::to_string(m),
Self::Generic(m) => serde_json::to_string(m),
};
let s = r.map_err(|e| SerError::custom(format!("failed to serialize struct as string {}", e)))?;
let s = r.map_err(|e| SerError::custom(format!("failed to serialize struct as string {e}")))?;

serializer.serialize_str(&s)
}
Expand Down
10 changes: 5 additions & 5 deletions lambda-events/src/event/dynamodb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl fmt::Display for StreamViewType {
StreamViewType::NewAndOldImages => "NEW_AND_OLD_IMAGES",
StreamViewType::KeysOnly => "KEYS_ONLY",
};
write!(f, "{}", val)
write!(f, "{val}")
}
}

Expand All @@ -48,7 +48,7 @@ impl fmt::Display for StreamStatus {
StreamStatus::Disabling => "DISABLING",
StreamStatus::Disabled => "DISABLED",
};
write!(f, "{}", val)
write!(f, "{val}")
}
}

Expand All @@ -69,7 +69,7 @@ impl fmt::Display for SharedIteratorType {
SharedIteratorType::AtSequenceNumber => "AT_SEQUENCE_NUMBER",
SharedIteratorType::AfterSequenceNumber => "AFTER_SEQUENCE_NUMBER",
};
write!(f, "{}", val)
write!(f, "{val}")
}
}

Expand All @@ -88,7 +88,7 @@ impl fmt::Display for OperationType {
OperationType::Modify => "MODIFY",
OperationType::Remove => "REMOVE",
};
write!(f, "{}", val)
write!(f, "{val}")
}
}

Expand All @@ -105,7 +105,7 @@ impl fmt::Display for KeyType {
KeyType::Hash => "HASH",
KeyType::Range => "RANGE",
};
write!(f, "{}", val)
write!(f, "{val}")
}
}

Expand Down
4 changes: 2 additions & 2 deletions lambda-extension/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ where
let io = TokioIo::new(tcp);
tokio::task::spawn(async move {
if let Err(err) = http1::Builder::new().serve_connection(io, make_service).await {
println!("Error serving connection: {:?}", err);
println!("Error serving connection: {err:?}");
}
});
}
Expand Down Expand Up @@ -305,7 +305,7 @@ where
let io = TokioIo::new(tcp);
tokio::task::spawn(async move {
if let Err(err) = http1::Builder::new().serve_connection(io, make_service).await {
println!("Error serving connection: {:?}", err);
println!("Error serving connection: {err:?}");
}
});
}
Expand Down