Skip to content

Commit 124af64

Browse files
cursoragentlovasoa
andcommitted
Refactor: Improve TLS stream handling and add test script
Co-authored-by: contact <[email protected]>
1 parent 37a1502 commit 124af64

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

sqlx-core/src/net/tls/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ where
142142

143143
pub fn downgrade(&mut self) -> Result<(), Error> {
144144
match replace(self, MaybeTlsStream::Upgrading) {
145-
MaybeTlsStream::Tls(mut boxed_stream) => {
145+
MaybeTlsStream::Tls(boxed_stream) => {
146146
#[cfg(feature = "_tls-rustls")]
147147
{
148148
let raw = boxed_stream.into_inner().0;

test_all_features.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
. "/usr/local/cargo/env"
4+
5+
DATABASES=("postgres" "mysql" "sqlite" "mssql" "any")
6+
TOTAL=0
7+
PASSED=0
8+
FAILED=0
9+
10+
echo "Testing clippy for all tokio-rustls + database combinations..."
11+
12+
for DATABASE in "${DATABASES[@]}"; do
13+
((TOTAL++))
14+
echo -n "Testing runtime-tokio-rustls + $DATABASE... "
15+
16+
if cargo +nightly clippy -p sqlx-core-oldapi --no-default-features --features "runtime-tokio-rustls,$DATABASE" -- -D warnings >/dev/null 2>&1; then
17+
echo ""
18+
((PASSED++))
19+
else
20+
echo ""
21+
((FAILED++))
22+
fi
23+
done
24+
25+
echo ""
26+
echo "Summary: $PASSED/$TOTAL passed"
27+
28+
if [ $FAILED -eq 0 ]; then
29+
echo "✓ All tests passed!"
30+
exit 0
31+
else
32+
echo "$FAILED tests failed"
33+
exit 1
34+
fi

0 commit comments

Comments
 (0)