Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Various chores#1272

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
paolobarbolini merged 6 commits intorust-postgres:masterfrompaolobarbolini:chores
Sep 21, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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
24 changes: 12 additions & 12 deletions.github/workflows/ci.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,15 +17,15 @@ jobs:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: sfackler/actions/rustup@master
- uses: sfackler/actions/rustfmt@master

clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: sfackler/actions/rustup@master
- run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
id: rust-version
Expand All@@ -36,12 +36,12 @@ jobs:
restore-keys: |
index-${{ runner.os }}-
- run: cargo generate-lockfile
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cargo/registry/cache
key: registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
- run: cargo fetch
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: target
key: clippy-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}y
Expand All@@ -51,24 +51,24 @@ jobs:
name: check-wasm32
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: sfackler/actions/rustup@master
- run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
id: rust-version
- run: rustup target add wasm32-unknown-unknown
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cargo/registry/index
key: index-${{ runner.os }}-${{ github.run_number }}
restore-keys: |
index-${{ runner.os }}-
- run: cargo generate-lockfile
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cargo/registry/cache
key: registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
- run: cargo fetch
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: target
key: check-wasm32-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
Expand All@@ -80,26 +80,26 @@ jobs:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- run: docker compose up -d
- uses: sfackler/actions/rustup@master
with:
version: 1.81.0
- run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
id: rust-version
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cargo/registry/index
key: index-${{ runner.os }}-${{ github.run_number }}
restore-keys: |
index-${{ runner.os }}-
- run: cargo generate-lockfile
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/.cargo/registry/cache
key: registry-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
- run: cargo fetch
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: target
key: test-target-${{ runner.os }}-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}y
Expand Down
3 changes: 2 additions & 1 deletionpostgres-derive/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,8 @@ authors = ["Steven Fackler <sfackler@palantir.com>"]
license = "MIT OR Apache-2.0"
edition = "2021"
description = "An internal crate used by postgres-types"
repository = "https://github.com/sfackler/rust-postgres"
repository = "https://github.com/rust-postgres/rust-postgres"
rust-version = "1.81"

[lib]
proc-macro = true
Expand Down
6 changes: 2 additions & 4 deletionspostgres-native-tls/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,11 +5,9 @@ authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
description = "TLS support for tokio-postgres via native-tls"
repository = "https://github.com/sfackler/rust-postgres"
repository = "https://github.com/rust-postgres/rust-postgres"
readme = "../README.md"

[badges]
circle-ci = { repository = "sfackler/rust-postgres" }
rust-version = "1.81"

[features]
default = ["runtime"]
Expand Down
6 changes: 2 additions & 4 deletionspostgres-openssl/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,11 +5,9 @@ authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
description = "TLS support for tokio-postgres via openssl"
repository = "https://github.com/sfackler/rust-postgres"
repository = "https://github.com/rust-postgres/rust-postgres"
readme = "../README.md"

[badges]
circle-ci = { repository = "sfackler/rust-postgres" }
rust-version = "1.81"

[features]
default = ["runtime"]
Expand Down
2 changes: 1 addition & 1 deletionpostgres-protocol/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -134,4 +134,4 @@

Look at the [release tags] for information about older releases.

[release tags]: https://github.com/sfackler/rust-postgres/releases
[release tags]: https://github.com/rust-postgres/rust-postgres/releases
3 changes: 2 additions & 1 deletionpostgres-protocol/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,8 +5,9 @@ authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2021"
description = "Low level Postgres protocol APIs"
license = "MIT OR Apache-2.0"
repository = "https://github.com/sfackler/rust-postgres"
repository = "https://github.com/rust-postgres/rust-postgres"
readme = "../README.md"
rust-version = "1.81"

[features]
default = []
Expand Down
14 changes: 5 additions & 9 deletionspostgres-protocol/src/types/mod.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -639,11 +639,10 @@ impl<'a> FallibleIterator for ArrayValues<'a> {
let val = if len < 0 {
None
} else {
if self.buf.len() < len as usize {
return Err("invalid value length".into());
}

let (val, buf) = self.buf.split_at(len as usize);
let (val, buf) = self
.buf
.split_at_checked(len as usize)
.ok_or("invalid value length")?;
self.buf = buf;
Some(val)
};
Expand DownExpand Up@@ -771,10 +770,7 @@ fn read_bound<'a>(
None
} else {
let len = len as usize;
if buf.len() < len {
return Err("invalid message size".into());
}
let (value, tail) = buf.split_at(len);
let (value, tail) = buf.split_at_checked(len).ok_or("invalid message size")?;
*buf = tail;
Some(value)
};
Expand Down
7 changes: 4 additions & 3 deletionspostgres-types/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,10 +5,11 @@ authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Conversions between Rust and Postgres values"
repository = "https://github.com/sfackler/rust-postgres"
repository = "https://github.com/rust-postgres/rust-postgres"
readme = "../README.md"
keywords = ["database", "postgres", "postgresql", "sql"]
categories = ["database"]
rust-version = "1.81"

[features]
derive = ["postgres-derive"]
Expand DownExpand Up@@ -49,8 +50,8 @@ chrono-04 = { version = "0.4.16", package = "chrono", default-features = false,
cidr-02 = { version = "0.2", package = "cidr", optional = true }
cidr-03 = { version = "0.3", package = "cidr", optional = true }
# eui48-04 will stop compiling and support will be removed
# See https://github.com/sfackler/rust-postgres/issues/1073
eui48-04 = { version = "0.4", package = "eui48", optional = true }
# See https://github.com/rust-postgres/rust-postgres/issues/1073
eui48-04 = { version = "0.4.6", package = "eui48", optional = true }
eui48-1 = { version = "1.0", package = "eui48", optional = true, default-features = false }
geo-types-06 = { version = "0.6", package = "geo-types", optional = true }
geo-types-0_7 = { version = "0.7.8", package = "geo-types", optional = true }
Expand Down
4 changes: 1 addition & 3 deletionspostgres-types/src/eui48_04.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,9 +16,7 @@ impl<'a> FromSql<'a> for MacAddress {

impl ToSql for MacAddress {
fn to_sql(&self, _: &Type, w: &mut BytesMut) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
let mut bytes = [0; 6];
bytes.copy_from_slice(self.as_bytes());
types::macaddr_to_sql(bytes, w);
types::macaddr_to_sql(self.to_array(), w);
Ok(IsNull::No)
}

Expand Down
4 changes: 1 addition & 3 deletionspostgres-types/src/eui48_1.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,9 +16,7 @@ impl<'a> FromSql<'a> for MacAddress {

impl ToSql for MacAddress {
fn to_sql(&self, _: &Type, w: &mut BytesMut) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
let mut bytes = [0; 6];
bytes.copy_from_slice(self.as_bytes());
types::macaddr_to_sql(bytes, w);
types::macaddr_to_sql(self.to_array(), w);
Ok(IsNull::No)
}

Expand Down
19 changes: 9 additions & 10 deletionspostgres-types/src/private.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,13 +3,13 @@ pub use bytes::BytesMut;
use std::error::Error;

pub fn read_be_i32(buf: &mut &[u8]) -> Result<i32, Box<dyn Error + Sync + Send>> {
if buf.len() < 4 {
return Err("invalid buffer size".into());
}
let mut bytes = [0; 4];
bytes.copy_from_slice(&buf[..4]);
let val = buf
.get(..4)
.ok_or("invalid buffer size")?
.try_into()
.unwrap();
*buf = &buf[4..];
Ok(i32::from_be_bytes(bytes))
Ok(i32::from_be_bytes(val))
}

pub fn read_value<'a, T>(
Expand All@@ -23,10 +23,9 @@ where
let value = if len < 0 {
None
} else {
if len as usize > buf.len() {
return Err("invalid buffer size".into());
}
let (head, tail) = buf.split_at(len as usize);
let (head, tail) = buf
.split_at_checked(len as usize)
.ok_or("invalid buffer size")?;
*buf = tail;
Some(head)
};
Expand Down
2 changes: 1 addition & 1 deletionpostgres/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -283,4 +283,4 @@

Look at the [release tags] for information about older releases.

[release tags]: https://github.com/sfackler/rust-postgres/releases
[release tags]: https://github.com/rust-postgres/rust-postgres/releases
6 changes: 2 additions & 4 deletionspostgres/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,10 +5,11 @@ authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
description = "A native, synchronous PostgreSQL client"
repository = "https://github.com/sfackler/rust-postgres"
repository = "https://github.com/rust-postgres/rust-postgres"
readme = "../README.md"
keywords = ["database", "postgres", "postgresql", "sql"]
categories = ["database"]
rust-version = "1.81"

[[bench]]
name = "bench"
Expand All@@ -17,9 +18,6 @@ harness = false
[package.metadata.docs.rs]
all-features = true

[badges]
circle-ci = { repository = "sfackler/rust-postgres" }

[features]
array-impls = ["tokio-postgres/array-impls"]
with-bit-vec-0_6 = ["tokio-postgres/with-bit-vec-0_6"]
Expand Down
2 changes: 1 addition & 1 deletiontokio-postgres/CHANGELOG.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -311,4 +311,4 @@

Look at the [release tags] for information about older releases.

[release tags]: https://github.com/sfackler/rust-postgres/releases
[release tags]: https://github.com/rust-postgres/rust-postgres/releases
6 changes: 2 additions & 4 deletionstokio-postgres/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,10 +5,11 @@ authors = ["Steven Fackler <sfackler@gmail.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
description = "A native, asynchronous PostgreSQL client"
repository = "https://github.com/sfackler/rust-postgres"
repository = "https://github.com/rust-postgres/rust-postgres"
readme = "../README.md"
keywords = ["database", "postgres", "postgresql", "sql", "async"]
categories = ["database"]
rust-version = "1.81"

[lib]
test = false
Expand All@@ -20,9 +21,6 @@ harness = false
[package.metadata.docs.rs]
all-features = true

[badges]
circle-ci = { repository = "sfackler/rust-postgres" }

[features]
default = ["runtime"]
runtime = ["tokio/net", "tokio/time"]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp