Skip to content

Commit

Permalink
Fix build with new nightly (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 authored Mar 2, 2024
1 parent f4c8493 commit b28bd9b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: rustup install nightly
- run: rustup component add --toolchain=nightly clippy miri rustfmt
- name: cd lib && cargo +nightly fmt -- --check
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: rustup install nightly
- name: cd lib && cargo +nightly build
run: cargo +nightly build
Expand Down
15 changes: 8 additions & 7 deletions cmp/tests/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use base64::prelude::{Engine, BASE64_STANDARD};
use base64::DecodeError::*;
use data_encoding::DecodeKind::*;
use data_encoding::{DecodeError, BASE64};
Expand Down Expand Up @@ -30,23 +31,23 @@ fn encode_exact() {
fn difference() {
let x = b"AAB=";
assert_eq!(BASE64.decode(x).err().unwrap(), DecodeError { position: 2, kind: Trailing });
assert_eq!(base64::decode(x).err().unwrap(), InvalidLastSymbol(2, b'B'));
assert_eq!(BASE64_STANDARD.decode(x).err().unwrap(), InvalidLastSymbol(2, b'B'));
let x = b"AA\nB=";
assert_eq!(BASE64.decode(x).err().unwrap(), DecodeError { position: 4, kind: Length });
assert_eq!(base64::decode(x).err().unwrap(), InvalidLength);
assert_eq!(BASE64_STANDARD.decode(x).err().unwrap(), InvalidByte(2, b'\n'));
let x = b"AAB";
assert_eq!(BASE64.decode(x).err().unwrap(), DecodeError { position: 0, kind: Length });
assert_eq!(base64::decode(x).err().unwrap(), InvalidPadding);
assert_eq!(BASE64_STANDARD.decode(x).err().unwrap(), InvalidPadding);
let x = b"AAA";
assert_eq!(BASE64.decode(x).err().unwrap(), DecodeError { position: 0, kind: Length });
assert_eq!(base64::decode(x).err().unwrap(), InvalidPadding);
assert_eq!(BASE64_STANDARD.decode(x).err().unwrap(), InvalidPadding);
let x = b"A\rA\nB=";
assert_eq!(BASE64.decode(x).err().unwrap(), DecodeError { position: 4, kind: Length });
assert_eq!(base64::decode(x).err().unwrap(), InvalidByte(1, b'\r'));
assert_eq!(BASE64_STANDARD.decode(x).err().unwrap(), InvalidByte(1, b'\r'));
let x = b"-_\r\n";
assert_eq!(BASE64.decode(x).err().unwrap(), DecodeError { position: 0, kind: Symbol });
assert_eq!(base64::decode(x).err().unwrap(), InvalidByte(0, b'-'));
assert_eq!(BASE64_STANDARD.decode(x).err().unwrap(), InvalidByte(0, b'-'));
let x = b"AA==AA==";
assert_eq!(BASE64.decode(x).unwrap(), vec![0, 0]);
assert_eq!(base64::decode(x).err().unwrap(), InvalidByte(2, b'='));
assert_eq!(BASE64_STANDARD.decode(x).err().unwrap(), InvalidByte(2, b'='));
}
4 changes: 1 addition & 3 deletions lib/fuzz/examples/analyze.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(core_intrinsics)]

extern crate data_encoding;
extern crate data_encoding_fuzz;

Expand Down Expand Up @@ -77,7 +75,7 @@ impl Stat<usize> {
let encoding = generate_specification(&mut data).encoding().unwrap();
let spec = encoding.specification();
let mut stat = HashMap::new();
assert!(stat.insert(Key::Bit, std::intrinsics::cttz(spec.symbols.len())).is_none());
assert!(stat.insert(Key::Bit, spec.symbols.len().trailing_zeros() as usize).is_none());
assert!(stat
.insert(Key::Msb, (spec.bit_order == BitOrder::MostSignificantFirst) as usize)
.is_none());
Expand Down
3 changes: 2 additions & 1 deletion lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
//! | Input | `data-encoding` | `base64` | GNU `base64` |
//! | ---------- | --------------- | --------- | ------------- |
//! | `AAB=` | `Trailing(2)` | `Last(2)` | `\x00\x00` |
//! | `AA\nB=` | `Length(4)` | `Length` | `\x00\x00` |
//! | `AA\nB=` | `Length(4)` | `Byte(2)` | `\x00\x00` |
//! | `AAB` | `Length(0)` | `Padding` | Invalid input |
//! | `AAA` | `Length(0)` | `Padding` | Invalid input |
//! | `A\rA\nB=` | `Length(4)` | `Byte(1)` | Invalid input |
Expand Down Expand Up @@ -155,6 +155,7 @@
#![warn(unused_results)]
#![allow(unused_unsafe)] // TODO(msrv)
#![warn(clippy::pedantic)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::enum_glob_use)]
#![allow(clippy::similar_names)]
#![allow(clippy::uninlined_format_args)] // TODO(msrv)
Expand Down
2 changes: 1 addition & 1 deletion www/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ html:
cargo build --target wasm32-unknown-unknown --release
rsync -a --delete static/ html
wasm-bindgen --no-typescript --no-modules \
target/wasm32-unknown-unknown/release/data_encoding_www.wasm \
../target/wasm32-unknown-unknown/release/data_encoding_www.wasm \
--out-dir html

.PHONY: clean
Expand Down
7 changes: 3 additions & 4 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(slice_group_by)]
#![feature(iter_intersperse)]

use std::borrow::Cow;
Expand Down Expand Up @@ -380,14 +379,14 @@ impl Flags {
},
jobs: BTreeMap::new(),
};
for actions in actions.group_by(|x, y| x.os == y.os) {
for actions in actions.chunk_by(|x, y| x.os == y.os) {
let mut job =
WorkflowJob { runs_on: format!("{}-latest", actions[0].os), steps: vec![] };
job.steps.push(WorkflowStep {
uses: Some("actions/checkout@v3".to_owned()),
uses: Some("actions/checkout@v4".to_owned()),
..Default::default()
});
for actions in actions.group_by(|x, y| x.toolchain == y.toolchain) {
for actions in actions.chunk_by(|x, y| x.toolchain == y.toolchain) {
job.steps.push(WorkflowStep {
run: Some(format!("rustup install {}", actions[0].toolchain)),
..Default::default()
Expand Down

0 comments on commit b28bd9b

Please sign in to comment.