Skip to content

Commit

Permalink
fix: clippy & rustfmt
Browse files Browse the repository at this point in the history
Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Aug 4, 2023
1 parent 9e25da1 commit 18dbdb5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
- name: Build code
run: cargo build
- name: Lint code format
run: cargo fmt --all -- --check
run: cargo fmt --all --check
- name: Lint code
run: cargo clippy --all -- -D warnings
run: cargo clippy --no-deps -- -D warnings

# MSRV
- name: Check MSRV
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jni = "0.19"
reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "sync"] }
openssl = { version = "0.10", features = ["vendored"] }
# bytes = "1.1"
prost = "0.11"
prost-types = "0.11"
http-cache-reqwest = "0.11"
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {
println!("cargo:rerun-if-changed={display_path}");
}
let file_descriptors =
protox::compile(proto_paths, &[proto_dir]).expect("Expected file descriptors");
protox::compile(proto_paths, [proto_dir]).expect("Expected file descriptors");
Config::new()
.compile_well_known_types()
.out_dir("src/commonMain/rust/protobuf")
Expand Down
4 changes: 2 additions & 2 deletions src/commonMain/rust/bridge/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ impl ToProtobuf<runtime::Event, ()> for Event {
runtime::event::LibraryItemsPushedToStorage { ids: ids.clone() },
)
}
Event::StreamsPushedToStorage { uid } => {
Event::StreamsPushedToStorage { uid: _ } => {
todo!()
}
Event::NotificationsPushedToStorage { ids } => {
Event::NotificationsPushedToStorage { ids: _ } => {
todo!()
}
Event::UserPulledFromAPI { uid } => {
Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/rust/env/kotlin_class_name.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::convert::TryFrom;
use std::hash::Hash;
use strum::{IntoEnumIterator, EnumIter};
use strum::{EnumIter, IntoEnumIterator};

#[derive(Clone, PartialEq, Eq, Hash, EnumIter)]
#[allow(non_camel_case_types)]
Expand Down
7 changes: 6 additions & 1 deletion src/commonMain/rust/model/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ pub struct AndroidModel {
}

impl AndroidModel {
pub fn new(profile: Profile, library: LibraryBucket, streams: StreamsBucket, notifications: NotificationsBucket) -> (AndroidModel, Effects) {
pub fn new(
profile: Profile,
library: LibraryBucket,
streams: StreamsBucket,
notifications: NotificationsBucket,
) -> (AndroidModel, Effects) {
let (continue_watching_preview, continue_watching_preview_effects) =
ContinueWatchingPreview::new(&library, &notifications);

Expand Down
8 changes: 5 additions & 3 deletions src/commonMain/rust/stremio_core_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ pub unsafe extern "C" fn Java_com_stremio_core_Core_initializeNative(
library.merge_bucket(other_bucket);
};
let streams = streams.unwrap_or(StreamsBucket::new(profile.uid()));
let notifications = notifications.unwrap_or(
NotificationsBucket::new::<AndroidEnv>(profile.uid(), vec![]),
);
let notifications = notifications.unwrap_or(NotificationsBucket::new::<
AndroidEnv,
>(
profile.uid(), vec![]
));
let (model, effects) =
AndroidModel::new(profile, library, streams, notifications);
let (runtime, rx) = Runtime::<AndroidEnv, _>::new(
Expand Down

0 comments on commit 18dbdb5

Please sign in to comment.