Skip to content

Commit

Permalink
Merge pull request #5 from phip1611/dev
Browse files Browse the repository at this point in the history
v0.2.0
  • Loading branch information
phip1611 authored Apr 11, 2023
2 parents 530d058 + 3eccc3c commit 382c10c
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 121 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
max_line_length = 80

[*.yml]
indent_size = 2
12 changes: 12 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: QA

on: [ push, pull_request ]

jobs:
spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# Executes "typos ."
- uses: crate-ci/[email protected]
25 changes: 12 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
runs-on:
- windows-latest
- ubuntu-latest
rust:
- stable
- nightly
- 1.52.1 # MSVR
- 1.60.0 # MSVR
steps:
- uses: actions/checkout@v2
# Important preparation step: override the latest default Rust version in GitHub CI
Expand All @@ -28,21 +27,21 @@ jobs:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --all-targets --verbose --features all
run: cargo build --all-targets --verbose --features alloc
# use some arbitrary no_std target
- name: Install no_std target thumbv7em-none-eabihf
run: rustup target add thumbv7em-none-eabihf
- name: Build (no_std)
run: cargo build --verbose --target thumbv7em-none-eabihf --features all
run: cargo build --verbose --target thumbv7em-none-eabihf --features alloc
- name: Run tests
run: cargo test --verbose --features all
run: cargo test --verbose --features alloc

style_checks:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.60.0
steps:
- uses: actions/checkout@v2
# Important preparation step: override the latest default Rust version in GitHub CI
Expand All @@ -55,6 +54,6 @@ jobs:
- name: Rustfmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --features all
run: cargo clippy --features alloc
- name: Rustdoc
run: cargo doc --features all
run: cargo doc --no-deps --document-private-items --features alloc
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# v0.2.0 (2023-04-11)
- MSRV is 1.60.0
- bitflags bump: 1.x -> 2.x
- few internal code improvements (less possible panics)
- `Mode::to_flags` now returns a Result
- Feature `all` was removed. Use `alloc` instead.
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ as GNU Longname. The maximum supported file name length is 100 characters includ
The maximum supported file size is 8GiB. Also, directories are not supported yet but only flat
collections of files.
"""
version = "0.1.8"
edition = "2018"
version = "0.2.0"
edition = "2021"
keywords = ["tar", "tarball", "archive"]
categories = ["data-structures", "no-std", "parser-implementations"]
readme = "README.md"
Expand All @@ -23,12 +23,11 @@ resolver = "2"
[features]
default = []
alloc = []
all = ["alloc"]

[dependencies]
bitflags = "1.3"
arrayvec = { version = "0.7", default-features = false }
bitflags = "2.0"
log = { version = "0.4", default-features = false }

[dev-dependencies]
env_logger = "0.9"
env_logger = "0.10"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn main() {
let entries = archive.entries().collect::<Vec<_>>();
println!("{:#?}", entries);
println!("content of last file:");
println!("{:#?}", entries[2].data_as_str().expect("Invalid UTF-8") );
println!("{:#?}", entries[2].data_as_str().expect("Should be valid UTF-8"));
}
```

Expand Down
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/bash
#!/usr/bin/env bash

cargo build --all-targets --verbose --features all
cargo build --all-targets --verbose --features alloc
# use some random no_std target
rustup target add thumbv7em-none-eabihf
cargo build --verbose --target thumbv7em-none-eabihf --features all
cargo test --verbose --features all
cargo build --verbose --target thumbv7em-none-eabihf --features alloc
cargo test --verbose --features alloc

cargo fmt -- --check
cargo clippy --features all
cargo doc --features all
cargo +1.60.0 clippy --features alloc
cargo +1.60.0 doc --no-deps --document-private-items --features alloc
7 changes: 5 additions & 2 deletions examples/alloc_feature.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
MIT License
Copyright (c) 2021 Philipp Schuster
Copyright (c) 2023 Philipp Schuster
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -37,5 +37,8 @@ fn main() {
let entries = archive.entries().collect::<Vec<_>>();
println!("{:#?}", entries);
println!("content of last file:");
println!("{:#?}", entries[2].data_as_str().expect("Invalid UTF-8"));
println!(
"{:#?}",
entries[2].data_as_str().expect("Should be valid UTF-8")
);
}
7 changes: 5 additions & 2 deletions examples/minimal.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
MIT License
Copyright (c) 2021 Philipp Schuster
Copyright (c) 2023 Philipp Schuster
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -35,5 +35,8 @@ fn main() {
let entries = archive.entries().collect::<Vec<_>>();
println!("{:#?}", entries);
println!("content of last file:");
println!("{:#?}", entries[2].data_as_str().expect("Invalid UTF-8"));
println!(
"{:#?}",
entries[2].data_as_str().expect("Should be valid UTF-8")
);
}
Loading

0 comments on commit 382c10c

Please sign in to comment.