Skip to content

Commit

Permalink
Merge pull request #87 from openebs/fmt
Browse files Browse the repository at this point in the history
Format files and pin compatible serde.
  • Loading branch information
tiagolobocastro authored Jul 18, 2024
2 parents eb9d43a + 65712dc commit 4cee46e
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-rust-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
submodules: 'recursive'
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-23.11
nix_path: nixpkgs=channel:nixos-24.05
- name: nix-shell
run: nix-shell --pure --run exit
- name: cargo-clippy
run: nix-shell --pure --run ./scripts/rust/linter.sh
- name: cargo-fmt
run: nix-shell --pure --run ./scripts/rust/style.sh
run: nix-shell --pure --run "FMT_OPTS=--check ./scripts/rust/style.sh"
6 changes: 6 additions & 0 deletions apis/events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ prost = "0.12.1"
chrono = "0.4.31"
once_cell = "1.18.0"
prost-extend = { path = "../../prost-extend" }

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
6 changes: 6 additions & 0 deletions apis/io-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ prost-types = "0.12.1"
serde = { version = "1.0.188", features = ["derive"] }
serde_derive = "1.0.188"
serde_json = "1.0.107"

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
6 changes: 6 additions & 0 deletions composer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ tracing = "0.1.37"
once_cell = "1.18.0"
ipnetwork = "0.20.0"
bollard = "0.15.0"

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
10 changes: 5 additions & 5 deletions composer/src/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,13 @@ impl Builder {

/// the name to be used as labels and network name
pub fn name(mut self, name: &str) -> Builder {
self.name = name.to_owned();
self.name = name.to_string();
self
}

/// set different label prefix for the network label
pub fn label_prefix(mut self, prefix: &str) -> Builder {
self.label_prefix = prefix.to_owned();
self.label_prefix = prefix.to_string();
self
}

Expand All @@ -727,7 +727,7 @@ impl Builder {
/// check if a container exists
pub fn container_exists(&self, name: &str) -> bool {
self.containers.iter().any(|(c, _)| c.name == name)
|| self.existing_containers.get(name).is_some()
|| self.existing_containers.contains_key(name)
}

/// add a generic container which runs a local binary
Expand Down Expand Up @@ -1103,7 +1103,7 @@ impl ComposeTest {
for k in &containers {
let name = k.id.clone().unwrap();
tracing::trace!("Lookup container for removal: {:?}", k.names);
if prune || (self.prune_matching && self.containers.get(&name).is_some()) {
if prune || (self.prune_matching && self.containers.contains_key(&name)) {
prune_containers.push(async move {
let remove = self.remove_container(&name).await;
if remove.is_ok() {
Expand Down Expand Up @@ -1671,7 +1671,7 @@ impl ComposeTest {
.await
.unwrap_or_default();

self.containers.get(name).is_some()
self.containers.contains_key(name)
|| containers.iter().any(|c| {
c.names
.clone()
Expand Down
6 changes: 6 additions & 0 deletions event-publisher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ tokio = { version = "1.32.0"}
tracing = "0.1.37"
serde_json = "1.0.107"
events-api = { path = "../apis/events" }

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
14 changes: 7 additions & 7 deletions nix/sources.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"nixpkgs": {
"branch": "release-23.05",
"branch": "release-24.05",
"description": "Nix Packages collection",
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9a333eaa80901efe01df07eade2c16d183761fa3",
"sha256": "0xhqjli4m9wkzv7xhs6fr1iajdjbv7xnj0bwvwldq9s6arlwkhj3",
"rev": "35f9f5784eb50cabac4db09c8c11035dacf36411",
"sha256": "1gq4ajsmg2f5jdmbdhdavcnlg32bzynvvidvb4648pk4gdcnr49h",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/9a333eaa80901efe01df07eade2c16d183761fa3.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/35f9f5784eb50cabac4db09c8c11035dacf36411.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"rust-overlay": {
Expand All @@ -17,10 +17,10 @@
"homepage": "",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "8dfbe2dffc28c1a18a29ffa34d5d0b269622b158",
"sha256": "0ddii9h5bwbihn4lwijbzknkbzdb11nglwdwrxdx8bf1blvcy199",
"rev": "d064703dc0657a49a17671c74b1a15ea7433e753",
"sha256": "06g1c1ys8ihd3vsjswqrkl8nv9lypizzgivbvwz1aycm34i3ib4z",
"type": "tarball",
"url": "https://github.com/oxalica/rust-overlay/archive/8dfbe2dffc28c1a18a29ffa34d5d0b269622b158.tar.gz",
"url": "https://github.com/oxalica/rust-overlay/archive/d064703dc0657a49a17671c74b1a15ea7433e753.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
6 changes: 6 additions & 0 deletions prost-extend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ tonic-build = "0.10.2"
chrono = "0.4.26"
serde = { version = "1.0.183", features = [ "derive" ] }
prost = "0.12.1"

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
4 changes: 2 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ profile ? "nightly", date ? "2024-02-06" }:
{ profile ? "nightly", version ? "2024-02-06" }:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {
Expand All @@ -8,7 +8,7 @@ let
in
let
rust-bin =
(rust.rust-bin.${profile}.${date}.default.override {
(rust.rust-bin.${profile}.${version}.default.override {
extensions = [ "rust-src" ];
});
in
Expand Down

0 comments on commit 4cee46e

Please sign in to comment.