Skip to content

Commit 19cb913

Browse files
committed
Simplify CI and formatting configuration
1 parent 5371d09 commit 19cb913

File tree

5 files changed

+22
-60
lines changed

5 files changed

+22
-60
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Continuous integration
2+
on: [push, pull_request]
3+
4+
jobs:
5+
ci:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
- uses: dtolnay/rust-toolchain@stable
10+
- run: cargo build
11+
- run: cargo test

.github/workflows/rust.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

rustfmt.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
unstable_features = true
2-
3-
overflow_delimited_expr = true
4-
spaces_around_ranges = true
5-
use_field_init_shorthand = true
6-
merge_derives = false
7-
1+
use_small_heuristics = "Max"
82
max_width = 90
9-
struct_lit_width = 40
103
chain_width = 70
11-
single_line_if_else_max_width = 60
4+
struct_lit_width = 50
5+
use_field_init_shorthand = true
6+
merge_derives = false

src/input.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,7 @@ where
108108
where
109109
Self: 'r,
110110
{
111-
let tracked = Tracked {
112-
value: self.value,
113-
constraint: Some(constraint),
114-
};
111+
let tracked = Tracked { value: self.value, constraint: Some(constraint) };
115112
(tracked, self.constraint)
116113
}
117114
}
@@ -156,10 +153,7 @@ where
156153
where
157154
Self: 'r,
158155
{
159-
let tracked = TrackedMut {
160-
value: self.value,
161-
constraint: Some(constraint),
162-
};
156+
let tracked = TrackedMut { value: self.value, constraint: Some(constraint) };
163157
(tracked, self.constraint)
164158
}
165159
}

src/track.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ pub trait Track: Trackable {
2525
/// Start tracking all accesses into a constraint.
2626
#[inline]
2727
fn track_with<'a>(&'a self, constraint: &'a Constraint<Self>) -> Tracked<'a, Self> {
28-
Tracked {
29-
value: self,
30-
constraint: Some(constraint),
31-
}
28+
Tracked { value: self, constraint: Some(constraint) }
3229
}
3330

3431
/// Start tracking all accesses and mutations into a constraint.
@@ -37,10 +34,7 @@ pub trait Track: Trackable {
3734
&'a mut self,
3835
constraint: &'a Constraint<Self>,
3936
) -> TrackedMut<'a, Self> {
40-
TrackedMut {
41-
value: self,
42-
constraint: Some(constraint),
43-
}
37+
TrackedMut { value: self, constraint: Some(constraint) }
4438
}
4539

4640
/// Whether this value fulfills the given constraints.
@@ -172,10 +166,7 @@ where
172166
/// defined on `T`. It should be called as `TrackedMut::downgrade(...)`.
173167
#[inline]
174168
pub fn downgrade(this: Self) -> Tracked<'a, T> {
175-
Tracked {
176-
value: this.value,
177-
constraint: this.constraint,
178-
}
169+
Tracked { value: this.value, constraint: this.constraint }
179170
}
180171

181172
/// Reborrow with a shorter lifetime.
@@ -184,10 +175,7 @@ where
184175
/// defined on `T`. It should be called as `TrackedMut::reborrow(...)`.
185176
#[inline]
186177
pub fn reborrow(this: &Self) -> Tracked<'_, T> {
187-
Tracked {
188-
value: this.value,
189-
constraint: this.constraint,
190-
}
178+
Tracked { value: this.value, constraint: this.constraint }
191179
}
192180

193181
/// Reborrow mutably with a shorter lifetime.
@@ -196,10 +184,7 @@ where
196184
/// defined on `T`. It should be called as `TrackedMut::reborrow_mut(...)`.
197185
#[inline]
198186
pub fn reborrow_mut(this: &mut Self) -> TrackedMut<'_, T> {
199-
TrackedMut {
200-
value: this.value,
201-
constraint: this.constraint,
202-
}
187+
TrackedMut { value: this.value, constraint: this.constraint }
203188
}
204189
}
205190

0 commit comments

Comments
 (0)