Skip to content

Commit

Permalink
build: use a more recent version of actions/cache
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Feb 12, 2025
1 parent 4ef317b commit 5ac3ff4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/actions/cache_nix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ runs:
- name: Restore and Save Cache
id: nix-restore-and-save
if: ${{ github.event_name == 'schedule' }}
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
uses: actions/cache@v4
with:
path: |
/tmp/nix-cache
Expand All @@ -26,7 +26,7 @@ runs:
- name: Restore Cache
id: nix-restore
if: ${{ github.event_name != 'schedule' }}
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84
uses: actions/cache/restore@v4
with:
path: |
/tmp/nix-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/nix_installer_and_cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
- name: Restore and Save Cache
id: nix-restore-and-save
if: ${{ github.event_name == 'schedule' }}
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
uses: actions/cache@v4
with:
path: |
/tmp/nix-cache
Expand All @@ -28,7 +28,7 @@ runs:
- name: Restore Cache
id: nix-restore
if: ${{ github.event_name != 'schedule' }}
uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84
uses: actions/cache/restore@v4
with:
path: |
/tmp/nix-cache
Expand Down
30 changes: 28 additions & 2 deletions implementations/rust/ockam/ockam_core/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,20 @@ impl<T: Decodable> Decodable for Request<T> {
let mut dec = Decoder::new(&deserialized);
let header: RequestHeader = dec.decode()?;
if header.has_body() {
let body = dec.input().get(dec.position()..deserialized.len()).unwrap();
let body = dec
.input()
.get(dec.position()..deserialized.len())
.ok_or_else(|| {
crate::Error::new(
Origin::Api,
Kind::Internal,
format!(
"can't access the remaining input bytes: {}/{}",
dec.position(),
deserialized.len()
),
)
})?;
Ok(Request {
header,
body: Some(<T as Decodable>::decode(body)?),
Expand Down Expand Up @@ -725,7 +738,20 @@ impl<T: Decodable> Decodable for Response<T> {
let header: ResponseHeader = dec.decode()?;
if header.is_ok() {
if header.has_body() {
let body = dec.input().get(dec.position()..deserialized.len()).unwrap();
let body = dec
.input()
.get(dec.position()..deserialized.len())
.ok_or_else(|| {
crate::Error::new(
Origin::Api,
Kind::Internal,
format!(
"can't access the remaining input bytes: {}/{}",
dec.position(),
deserialized.len()
),
)
})?;
Ok(Response {
header,
body: Some(<T as Decodable>::decode(body)?),
Expand Down

0 comments on commit 5ac3ff4

Please sign in to comment.