Skip to content

Commit

Permalink
Maintenance release
Browse files Browse the repository at this point in the history
  • Loading branch information
KizzyCode committed Apr 6, 2023
1 parent b9115f7 commit 743aad6
Show file tree
Hide file tree
Showing 26 changed files with 1,521 additions and 1,675 deletions.
8 changes: 4 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ platform:
configuration:
- --features=
- --features=native_types
- --features=no_std
- --features=std
- --features=no_panic
- --features=native_types,no_std
- --features=no_std,no_panic
- --features=native_types,std
- --features=std,no_panic
- --features=no_panic,native_types
- --features=native_types,no_std,no_panic
- --features=native_types,std,no_panic


# General environment vars
Expand Down
10 changes: 10 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
max_width = 120
newline_style = "Unix"
fn_args_layout = "Tall"
use_small_heuristics = "Max"
use_field_init_shorthand = true
use_try_shorthand = true

# Unstable args
unstable_features = true
group_imports = "One"
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"vadimcn.vscode-lldb",
"rust-lang.rust-analyzer"
]
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "cargo test",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=http_tiny"
],
"filter": {
"name": "http_tiny",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"rust-analyzer.checkOnSave.allTargets": true,
"[rust]": {
"editor.formatOnSave": true
}
}
14 changes: 14 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cargo",
"command": "build",
"problemMatcher": [
"$rustc"
],
"group": "build",
"label": "rust: cargo build"
}
]
}
11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "asn1_der"
version = "0.7.5"
edition = "2018"
version = "0.7.6"
edition = "2021"
authors = ["KizzyCode Software Labs./Keziah Biermann <[email protected]>"]
keywords = ["asn1", "asn1-der", "serialize", "deserialize", "no_panic"]
categories = ["encoding"]
Expand All @@ -17,9 +17,9 @@ appveyor = { repository = "KizzyCode/asn1_der-rust" }


[features]
default = ["native_types"]
default = ["std", "native_types"]
std = []
native_types = []
no_std = []
no_panic = ["no-panic"]


Expand All @@ -33,8 +33,7 @@ serde_json = "1.0"


[profile.release]
lto = "thin"
overflow-checks = true

[profile.bench]
overflow-checks = true
overflow-checks = true
2 changes: 1 addition & 1 deletion LICENSE BSD 2-CLAUSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020, Keziah Biermann
Copyright (c) 2023, Keziah Biermann
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion LICENSE MIT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Keziah Biermann
Copyright (c) 2023 Keziah Biermann

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
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/asn1_der.svg)](https://crates.io/crates/asn1_der)
[![Download numbers](https://img.shields.io/crates/d/asn1_der.svg)](https://crates.io/crates/asn1_der)
[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/github/KizzyCode/asn1_der-rust?svg=true)](https://ci.appveyor.com/project/KizzyCode/asn1-der-rust)
[![dependency status](https://deps.rs/crate/asn1_der/0.7.5/status.svg)](https://deps.rs/crate/asn1_der/0.7.5)
[![dependency status](https://deps.rs/crate/asn1_der/latest/status.svg)](https://deps.rs/crate/asn1_der)

# asn1_der
Welcome to `asn1_der` 🎉
Expand All @@ -17,29 +17,31 @@ allocations and unnecessary copies.


## Example
```rust
```ignore
use asn1_der::{
DerObject,
typed::{ DerEncodable, DerDecodable }
};
/// An ASN.1-DER encoded integer `7`
const INT7: &'static[u8] = b"\x02\x01\x07";
fn main() {
/// An ASN.1-DER encoded integer `7`
const INT7: &'static[u8] = b"\x02\x01\x07";
// Decode an arbitrary DER object
let object = DerObject::decode(INT7).expect("Failed to decode object");
// Decode an arbitrary DER object
let object = DerObject::decode(INT7).expect("Failed to decode object");
// Encode an arbitrary DER object
let mut encoded_object = Vec::new();
object.encode(&mut encoded_object).expect("Failed to encode object");
// Encode an arbitrary DER object
let mut encoded_object = Vec::new();
object.encode(&mut encoded_object).expect("Failed to encode object");
// Decode a `u8`
let number = u8::decode(INT7).expect("Failed to decode number");
assert_eq!(number, 7);
// Decode a `u8`
let number = u8::decode(INT7).expect("Failed to decode number");
assert_eq!(number, 7);
// Encode a new `u8`
let mut encoded_number = Vec::new();
7u8.encode(&mut encoded_number).expect("Failed to encode number");
// Encode a new `u8`
let mut encoded_number = Vec::new();
7u8.encode(&mut encoded_number).expect("Failed to encode number");
}
```

For the (de-)serialization of structs and similar via `derive`, see
Expand Down Expand Up @@ -77,7 +79,7 @@ of errors that can also happen in this crate. This especially includes:
- When decoding a native owned type such as `Vec<u8>`, `SequenceVec(Vec<T>)` or `String`
- During error propagation

If the crate is compiled with `no_std` enabled, it does performy any dynamic memory allocation
If the crate is compiled without `std` enabled, it does performy any dynamic memory allocation
directly by itself – however for foreign implementations passed to this crate may still allocate
memory and fail (e.g. a custom `Sink` implementation).

Expand Down
Loading

0 comments on commit 743aad6

Please sign in to comment.