Skip to content

Commit 3b46dac

Browse files
committed
fix warnings and prepare 0.6.3
1 parent 4cf00f0 commit 3b46dac

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## [0.6.3] - 2022-03-13
10+
11+
### Fixed
12+
13+
- improved hygiene around `self` parameters
14+
- fix contract messages containing `{}` emitting warnings as they are interpreted as format strings
15+
916
## [0.6.2] - 2021-07-21
1017

1118
### Changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "contracts"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["karroffel <[email protected]>"]
55
edition = "2018"
66
repository = "https://gitlab.com/karroffel/contracts"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
![Lines of Code][loc]
66

77
[license]: https://img.shields.io/badge/license-MPL%202.0-blue.svg
8-
[build]: https://gitlab.com/karroffel/contracts/badges/master/build.svg
8+
[build]: https://gitlab.com/karroffel/contracts/badges/master/pipeline.svg
99
[loc]: https://tokei.rs/b1/gitlab/karroffel/contracts?category=code
1010

1111
Annotate functions and methods with "contracts", using *invariants*,
@@ -150,7 +150,7 @@ To install the latest version, add `contracts` to the dependency section of the
150150

151151
```
152152
[dependencies]
153-
contracts = "0.6.2"
153+
contracts = "0.6.3"
154154
```
155155

156156
To then bring all procedural macros into scope, you can add `use contracts::*;`

examples/library.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn main() {
6060
println!("Adding a book.");
6161

6262
let lent_successful = lib.lend("Das Kapital");
63-
assert_eq!(lent_successful, true);
63+
assert!(lent_successful);
6464

6565
if lent_successful {
6666
println!("Lent out the book.");

src/implementation/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl ContractType {
125125
/// Representation of a contract
126126
#[derive(Debug)]
127127
pub(crate) struct Contract {
128-
pub(crate) span: Span,
128+
pub(crate) _span: Span,
129129
pub(crate) ty: ContractType,
130130
pub(crate) mode: ContractMode,
131131
pub(crate) assertions: Vec<Expr>,
@@ -144,7 +144,7 @@ impl Contract {
144144
let span = Span::call_site();
145145

146146
Self {
147-
span,
147+
_span: span,
148148
ty,
149149
mode,
150150
assertions,
@@ -210,7 +210,7 @@ impl FuncWithContracts {
210210

211211
// remove contract attributes
212212
{
213-
let attrs = std::mem::replace(&mut func.attrs, vec![]);
213+
let attrs = std::mem::take(&mut func.attrs);
214214

215215
let other_attrs = attrs
216216
.into_iter()

tests/functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ fn test_unbound_parameters_clippy() {
158158
}
159159

160160
#[test]
161-
#[deny(non_fmt_panic)]
161+
#[deny(non_fmt_panics)]
162162
fn test_braced_condition_expression_clippy() {
163163
#[requires(if __y == 3 {
164164
__y != 0

0 commit comments

Comments
 (0)