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

Update to edition 2018 #166

Merged
merged 3 commits into from
Aug 16, 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
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
rust:
- 1.30.0
- 1.31.0
- stable
- beta
- nightly
Expand All @@ -27,12 +27,14 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- run: rustup component add rustfmt-preview
- name: cargo fmt --all -- --check if stable
- name: Use MSRV Cargo.lock
run: cp Cargo.lock.msrv Cargo.lock
if: matrix.rust == '1.31.0'
- name: cargo fmt --all -- --check
run: |
if [ "${{ matrix.rust }}" = "stable" ]; then
cargo fmt --all -- --check
fi
rustup component add rustfmt-preview
cargo fmt --all -- --check
if: matrix.rust == 'stable'
- run: |
cargo build --verbose
- run: |
Expand Down
14 changes: 14 additions & 0 deletions Cargo.lock.msrv

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
@@ -1,5 +1,4 @@
[package]

name = "pkg-config"
version = "0.3.30"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
Expand All @@ -12,7 +11,8 @@ A library to run the pkg-config system tool at build time in order to be used in
Cargo build scripts.
"""
keywords = ["build-dependencies"]
rust-version = "1.30"
rust-version = "1.31"
edition = "2018"

[dev-dependencies]
lazy_static = "1"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pkg-config-rs

[![Build Status](https://github.com/rust-lang/pkg-config-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/rust-lang/pkg-config-rs/actions)
[![Rust](https://img.shields.io/badge/rust-1.30%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/pkg-config-rs/)
[![Rust](https://img.shields.io/badge/rust-1.31%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/pkg-config-rs/)

[Documentation](https://docs.rs/pkg-config)

Expand All @@ -13,7 +13,7 @@ You can use this crate directly to probe for specific libraries, or use
[system-deps](https://github.com/gdesmott/system-deps) to declare all your
`pkg-config` dependencies in `Cargo.toml`.

This library requires Rust 1.30+.
This library requires Rust 1.31+.

# Example

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ impl Display for WrappedCommand {
impl error::Error for Error {}

impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
// Failed `unwrap()` prints Debug representation, but the default debug format lacks helpful instructions for the end users
<Error as fmt::Display>::fmt(self, f)
}
}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
match *self {
Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name),
Error::CrossCompilation => f.write_str(
Expand Down Expand Up @@ -407,7 +407,7 @@ impl fmt::Display for Error {
}
}

fn format_output(output: &Output, f: &mut fmt::Formatter) -> fmt::Result {
fn format_output(output: &Output, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let stdout = String::from_utf8_lossy(&output.stdout);
if !stdout.is_empty() {
write!(f, "\n--- stdout\n{}", stdout)?;
Expand Down
5 changes: 1 addition & 4 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
extern crate pkg_config;
#[macro_use]
extern crate lazy_static;

use lazy_static::lazy_static;
use pkg_config::Error;
use std::env;
use std::path::PathBuf;
Expand Down