Skip to content

Commit

Permalink
Update toolchain to 1.72 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjg authored Sep 1, 2023
1 parent f1c07b3 commit abbd080
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
toolchain: 1.72.0
default: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
Expand All @@ -29,7 +29,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
toolchain: 1.72.0
default: true
components: clippy
- uses: Swatinem/rust-cache@v2
Expand All @@ -56,7 +56,7 @@ jobs:
strategy:
matrix:
toolchain:
- 1.70.0
- 1.72.0
- nightly
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
steps:
Expand All @@ -77,7 +77,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
toolchain: 1.72.0
default: true
- uses: Swatinem/rust-cache@v2
- run: ./scripts/ci/build-test
Expand All @@ -90,7 +90,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
toolchain: 1.72.0
default: true
- uses: Swatinem/rust-cache@v2
- run: ./scripts/ci/build-test
Expand Down
2 changes: 1 addition & 1 deletion autosurgeon-derive/tests/reconcile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ fn reconcile_struct_enum_key() {
manufacturer: "Audi".to_string(),
},
);
let Vehicle::Truck{num_wheels, ..} = &mut vehicles[2] else {
let Vehicle::Truck { num_wheels, .. } = &mut vehicles[2] else {
panic!("should be a truck");
};
*num_wheels = 20;
Expand Down
15 changes: 7 additions & 8 deletions autosurgeon/src/hydrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn hydrate_path<'a, D: ReadDoc, H: Hydrate, P: IntoIterator<Item = Prop<'a>>
}
};
let Some(mut obj_type) = doc.object_type(&obj) else {
return Ok(None)
return Ok(None);
};
while let Some(path_elem) = path.next() {
match (&prop, obj_type) {
Expand Down Expand Up @@ -383,22 +383,22 @@ mod tests {
}],
};
let result: HashMap<String, Company> =
hydrate_path(&doc, &automerge::ROOT, vec!["companies".into()].into_iter())
hydrate_path(&doc, &automerge::ROOT, vec!["companies".into()])
.unwrap()
.unwrap();
let mut expected = HashMap::new();
expected.insert("Microsoft".to_string(), expected_ms.clone());
assert_eq!(expected, result);

let result: Company = hydrate_path(&doc, &companies, vec!["Microsoft".into()].into_iter())
let result: Company = hydrate_path(&doc, &companies, vec!["Microsoft".into()])
.unwrap()
.unwrap();
assert_eq!(result, expected_ms);

let satya: Employee = hydrate_path(
&doc,
&companies,
vec!["Microsoft".into(), "employees".into(), 0_usize.into()].into_iter(),
vec!["Microsoft".into(), "employees".into(), 0_usize.into()],
)
.unwrap()
.unwrap();
Expand All @@ -412,8 +412,7 @@ mod tests {
"employees".into(),
0_usize.into(),
"name".into(),
]
.into_iter(),
],
)
.unwrap()
.unwrap();
Expand All @@ -426,7 +425,7 @@ mod tests {
doc.put(&automerge::ROOT, "name", "Moist von Lipwig")
.unwrap();
doc.put(&automerge::ROOT, "number", 1_u64).unwrap();
let moist = hydrate_path::<_, Employee, _>(&doc, &automerge::ROOT, vec![].into_iter())
let moist = hydrate_path::<_, Employee, _>(&doc, &automerge::ROOT, vec![])
.unwrap()
.unwrap();
assert_eq!(
Expand All @@ -446,7 +445,7 @@ mod tests {
.unwrap();
doc.put(&moist, "name", "Moist von Lipwig").unwrap();
doc.put(&moist, "number", 1_u64).unwrap();
let moist = hydrate_path::<_, Employee, _>(&doc, &moist, vec![].into_iter())
let moist = hydrate_path::<_, Employee, _>(&doc, &moist, vec![])
.unwrap()
.unwrap();
assert_eq!(
Expand Down
5 changes: 4 additions & 1 deletion autosurgeon/src/hydrate/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ where
M: FromIterator<(K, V)>,
{
let Some(obj_type) = doc.object_type(obj) else {
return Err(HydrateError::unexpected("a map", "a scalar value".to_string()))
return Err(HydrateError::unexpected(
"a map",
"a scalar value".to_string(),
));
};
match obj_type {
ObjType::Map | ObjType::Table => doc
Expand Down

0 comments on commit abbd080

Please sign in to comment.