Skip to content

Commit dc3b7b6

Browse files
authored
Merge pull request #166 from kornelski/ed2018
Update to edition 2018
2 parents 246ece2 + 75847d1 commit dc3b7b6

File tree

6 files changed

+30
-17
lines changed

6 files changed

+30
-17
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
rust:
21-
- 1.30.0
21+
- 1.31.0
2222
- stable
2323
- beta
2424
- nightly
@@ -27,12 +27,14 @@ jobs:
2727
- uses: dtolnay/rust-toolchain@master
2828
with:
2929
toolchain: ${{ matrix.rust }}
30-
- run: rustup component add rustfmt-preview
31-
- name: cargo fmt --all -- --check if stable
30+
- name: Use MSRV Cargo.lock
31+
run: cp Cargo.lock.msrv Cargo.lock
32+
if: matrix.rust == '1.31.0'
33+
- name: cargo fmt --all -- --check
3234
run: |
33-
if [ "${{ matrix.rust }}" = "stable" ]; then
34-
cargo fmt --all -- --check
35-
fi
35+
rustup component add rustfmt-preview
36+
cargo fmt --all -- --check
37+
if: matrix.rust == 'stable'
3638
- run: |
3739
cargo build --verbose
3840
- run: |

Cargo.lock.msrv

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[package]
2-
32
name = "pkg-config"
43
version = "0.3.30"
54
authors = ["Alex Crichton <[email protected]>"]
@@ -12,7 +11,8 @@ A library to run the pkg-config system tool at build time in order to be used in
1211
Cargo build scripts.
1312
"""
1413
keywords = ["build-dependencies"]
15-
rust-version = "1.30"
14+
rust-version = "1.31"
15+
edition = "2018"
1616

1717
[dev-dependencies]
1818
lazy_static = "1"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pkg-config-rs
22

33
[![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)
4-
[![Rust](https://img.shields.io/badge/rust-1.30%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/pkg-config-rs/)
4+
[![Rust](https://img.shields.io/badge/rust-1.31%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/pkg-config-rs/)
55

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

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

16-
This library requires Rust 1.30+.
16+
This library requires Rust 1.31+.
1717

1818
# Example
1919

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,14 @@ impl Display for WrappedCommand {
259259
impl error::Error for Error {}
260260

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

268268
impl fmt::Display for Error {
269-
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
269+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
270270
match *self {
271271
Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name),
272272
Error::CrossCompilation => f.write_str(
@@ -407,7 +407,7 @@ impl fmt::Display for Error {
407407
}
408408
}
409409

410-
fn format_output(output: &Output, f: &mut fmt::Formatter) -> fmt::Result {
410+
fn format_output(output: &Output, f: &mut fmt::Formatter<'_>) -> fmt::Result {
411411
let stdout = String::from_utf8_lossy(&output.stdout);
412412
if !stdout.is_empty() {
413413
write!(f, "\n--- stdout\n{}", stdout)?;

tests/test.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
extern crate pkg_config;
2-
#[macro_use]
3-
extern crate lazy_static;
4-
1+
use lazy_static::lazy_static;
52
use pkg_config::Error;
63
use std::env;
74
use std::path::PathBuf;

0 commit comments

Comments
 (0)