Skip to content
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

Remove wildcard re-exports #682

Merged
merged 7 commits into from
Mar 27, 2024
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
15 changes: 15 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,18 @@ jobs:
env:
DO_WASM: true
run: ./contrib/test.sh

API:
name: Check for changes to the public API
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout Crate
uses: actions/checkout@v3
- name: Checkout Toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-public-api
run: cargo install --locked cargo-public-api
- name: Running API checker script
run: ./contrib/check-for-api-changes.sh
184 changes: 114 additions & 70 deletions api/all-features.txt

Large diffs are not rendered by default.

167 changes: 101 additions & 66 deletions api/alloc.txt

Large diffs are not rendered by default.

167 changes: 101 additions & 66 deletions api/default-features.txt

Large diffs are not rendered by default.

168 changes: 102 additions & 66 deletions api/global-context.txt

Large diffs are not rendered by default.

149 changes: 92 additions & 57 deletions api/no-default-features.txt

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions contrib/update-lock-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Update the minimal/recent lock file

set -euo pipefail

for file in Cargo-minimal.lock Cargo-recent.lock; do
cp --force "$file" Cargo.lock
cargo check
cp --force Cargo.lock "$file"
done
38 changes: 38 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
default:
@just --list

# Cargo build everything.
build:
cargo build --all-targets --all-features

# Cargo check everything.
check:
cargo check --all-targets --all-features

# Lint everything.
lint:
cargo clippy --all-targets --all-features -- --deny warnings

# Check the formatting
format:
cargo +nightly fmt --check

# Quick and dirty CI useful for pre-push checks.
sane: lint
cargo test --quiet --all-targets --no-default-features > /dev/null || exit 1
cargo test --quiet --all-targets > /dev/null || exit 1
cargo test --quiet --all-targets --all-features > /dev/null || exit 1

# doctests don't get run from workspace root with `cargo test`.
cargo test --quiet --doc || exit 1

# Make an attempt to catch feature gate problems in doctests
cargo test --manifest-path Cargo.toml --doc --no-default-features > /dev/null || exit 1

# Check for API changes.
check-api:
./contrib/check-for-api-changes.sh

# Update the lock files.
update-lock-files:
./contrib/update-lock-files.sh
2 changes: 1 addition & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::mem::ManuallyDrop;
use core::ptr::NonNull;

#[cfg(feature = "alloc")]
pub use self::alloc_only::*;
pub use self::alloc_only::{All, SignOnly, VerifyOnly};
use crate::ffi::types::{c_uint, c_void, AlignedType};
use crate::ffi::{self, CPtr};
use crate::{Error, Secp256k1};
Expand Down
13 changes: 9 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ use core::marker::PhantomData;
use core::ptr::NonNull;
use core::{fmt, mem, str};

#[cfg(feature = "global-context")]
pub use context::global::SECP256K1;
#[cfg(all(feature = "global-context", feature = "std"))]
pub use context::global::{self, SECP256K1};
#[cfg(feature = "hashes")]
use hashes::Hash;
#[cfg(feature = "rand")]
Expand All @@ -184,10 +184,15 @@ pub use secp256k1_sys as ffi;
#[cfg(feature = "serde")]
pub use serde;

pub use crate::context::*;
#[cfg(feature = "alloc")]
pub use crate::context::{All, SignOnly, VerifyOnly};
pub use crate::context::{
AllPreallocated, Context, PreallocatedContext, SignOnlyPreallocated, Signing, Verification,
VerifyOnlyPreallocated,
};
use crate::ffi::types::AlignedType;
use crate::ffi::CPtr;
pub use crate::key::{PublicKey, SecretKey, *};
pub use crate::key::{InvalidParityValue, Keypair, Parity, PublicKey, SecretKey, XOnlyPublicKey};
pub use crate::scalar::Scalar;

/// Trait describing something that promises to be a 32-byte random number; in particular,
Expand Down
Loading