From dcfed28ff46bba7bc47b345379b95d184020dad7 Mon Sep 17 00:00:00 2001 From: brendanobra Date: Fri, 7 Nov 2025 08:37:51 -0800 Subject: [PATCH 1/2] chore: agressive clippy --- .../src/firebolt/handlers/discovery_rpc.rs | 8 ++++---- core/main/src/state/openrpc_state.rs | 2 +- core/sdk/src/api/apps.rs | 8 ++++---- core/sdk/src/api/device/entertainment_data.rs | 16 +++++++++------- core/sdk/src/api/firebolt/fb_discovery.rs | 16 +++++++++------- .../api/firebolt/fb_lifecycle_management.rs | 12 ++++++------ core/sdk/src/api/firebolt/provider.rs | 19 +++++++++++-------- core/sdk/src/api/manifest/app_library.rs | 8 ++++---- core/sdk/src/api/manifest/device_manifest.rs | 2 +- core/sdk/src/extn/extn_client_message.rs | 2 +- 10 files changed, 50 insertions(+), 43 deletions(-) diff --git a/core/main/src/firebolt/handlers/discovery_rpc.rs b/core/main/src/firebolt/handlers/discovery_rpc.rs index 9e01a292d..a2f2787a5 100644 --- a/core/main/src/firebolt/handlers/discovery_rpc.rs +++ b/core/main/src/firebolt/handlers/discovery_rpc.rs @@ -442,7 +442,7 @@ impl DiscoveryServer for DiscoveryImpl { ) -> RpcResult { let response = ProviderResponse { correlation_id: entity_info.correlation_id, - result: ProviderResponsePayload::EntityInfoResponse(entity_info.result), + result: ProviderResponsePayload::EntityInfoResponse(Box::new(entity_info.result)), }; ProviderBroker::provider_response(&self.state, response).await; Ok(true) @@ -545,7 +545,7 @@ fn update_intent( match request.intent.clone() { Some(NavigationIntent::NavigationIntentStrict(navigation_intent)) => { - let updated_navigation_intent = match navigation_intent { + let updated_navigation_intent = match *navigation_intent { NavigationIntentStrict::Home(mut home_intent) => { home_intent.context.source = source; home_intent.context.age_policy = new_age_policy; @@ -600,9 +600,9 @@ fn update_intent( LaunchRequest { app_id: request.app_id, - intent: Some(NavigationIntent::NavigationIntentStrict( + intent: Some(NavigationIntent::NavigationIntentStrict(Box::new( updated_navigation_intent, - )), + ))), } } Some(NavigationIntent::NavigationIntentLoose(mut loose_intent)) => { diff --git a/core/main/src/state/openrpc_state.rs b/core/main/src/state/openrpc_state.rs index a116ee9e4..ed2c0e206 100644 --- a/core/main/src/state/openrpc_state.rs +++ b/core/main/src/state/openrpc_state.rs @@ -33,7 +33,7 @@ pub mod openrpc_validator { } } - #[derive(Debug, Clone)] + #[derive(Debug, Clone, Default)] pub struct RpcMethodValidator; impl RpcMethodValidator { diff --git a/core/sdk/src/api/apps.rs b/core/sdk/src/api/apps.rs index a25c5d14c..ca48285b5 100644 --- a/core/sdk/src/api/apps.rs +++ b/core/sdk/src/api/apps.rs @@ -317,15 +317,15 @@ mod tests { }, }; - app.update_intent(NavigationIntent::NavigationIntentStrict( + app.update_intent(NavigationIntent::NavigationIntentStrict(Box::new( NavigationIntentStrict::Home(home_intent.clone()), - )); + ))); assert_eq!( app.launch.intent, - Some(NavigationIntent::NavigationIntentStrict( + Some(NavigationIntent::NavigationIntentStrict(Box::new( NavigationIntentStrict::Home(home_intent), - )) + ))) ); } diff --git a/core/sdk/src/api/device/entertainment_data.rs b/core/sdk/src/api/device/entertainment_data.rs index e31d8606a..91705344a 100644 --- a/core/sdk/src/api/device/entertainment_data.rs +++ b/core/sdk/src/api/device/entertainment_data.rs @@ -391,7 +391,7 @@ pub struct ContentPolicy { #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] #[serde(untagged)] pub enum NavigationIntent { - NavigationIntentStrict(NavigationIntentStrict), + NavigationIntentStrict(Box), NavigationIntentLoose(NavigationIntentLoose), } @@ -399,7 +399,7 @@ pub enum NavigationIntent { // To avoid the data loss during IEC InternalNavigationIntent is created so the Firebolt specification is not affected #[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] pub enum InternalNavigationIntent { - NavigationIntentStrict(InternalNavigationIntentStrict), + NavigationIntentStrict(Box), NavigationIntentLoose(NavigationIntentLoose), } @@ -407,7 +407,9 @@ impl From for InternalNavigationIntent { fn from(value: NavigationIntent) -> Self { match value { NavigationIntent::NavigationIntentLoose(l) => Self::NavigationIntentLoose(l), - NavigationIntent::NavigationIntentStrict(s) => Self::NavigationIntentStrict(s.into()), + NavigationIntent::NavigationIntentStrict(s) => { + Self::NavigationIntentStrict(Box::new((*s).into())) + } } } } @@ -418,7 +420,7 @@ impl From for NavigationIntent { match value { InternalNavigationIntent::NavigationIntentLoose(l) => Self::NavigationIntentLoose(l), InternalNavigationIntent::NavigationIntentStrict(s) => { - Self::NavigationIntentStrict(s.into()) + Self::NavigationIntentStrict(Box::new((*s).into())) } } } @@ -426,9 +428,9 @@ impl From for NavigationIntent { impl Default for NavigationIntent { fn default() -> Self { - NavigationIntent::NavigationIntentStrict( - NavigationIntentStrict::Home(HomeIntent::default()), - ) + NavigationIntent::NavigationIntentStrict(Box::new(NavigationIntentStrict::Home( + HomeIntent::default(), + ))) } } diff --git a/core/sdk/src/api/firebolt/fb_discovery.rs b/core/sdk/src/api/firebolt/fb_discovery.rs index 1e2c03b00..0ea17fdf1 100644 --- a/core/sdk/src/api/firebolt/fb_discovery.rs +++ b/core/sdk/src/api/firebolt/fb_discovery.rs @@ -484,20 +484,22 @@ mod tests { let launch_request = LaunchRequest { app_id: "test_app".to_string(), - intent: Some(NavigationIntent::NavigationIntentStrict( + intent: Some(NavigationIntent::NavigationIntentStrict(Box::new( NavigationIntentStrict::Home(home_intent), - )), + ))), }; let intent = launch_request.get_intent(); assert_eq!( intent, - NavigationIntent::NavigationIntentStrict(NavigationIntentStrict::Home(HomeIntent { - context: DiscoveryContext { - source: "test_source".to_string(), - age_policy: None, + NavigationIntent::NavigationIntentStrict(Box::new(NavigationIntentStrict::Home( + HomeIntent { + context: DiscoveryContext { + source: "test_source".to_string(), + age_policy: None, + } } - })) + ))) ); } diff --git a/core/sdk/src/api/firebolt/fb_lifecycle_management.rs b/core/sdk/src/api/firebolt/fb_lifecycle_management.rs index b51f890e0..97d3043c4 100644 --- a/core/sdk/src/api/firebolt/fb_lifecycle_management.rs +++ b/core/sdk/src/api/firebolt/fb_lifecycle_management.rs @@ -256,11 +256,11 @@ mod tests { fn test_get_launch_request() { let launch_params = LifecycleManagementLaunchParameters { app_id: "test_app".to_string(), - intent: Some(InternalNavigationIntent::NavigationIntentStrict( + intent: Some(InternalNavigationIntent::NavigationIntentStrict(Box::new( InternalNavigationIntentStrict::Home(HomeIntent { context: DiscoveryContext::new("voice", None), }), - )), + ))), }; let launch_request = launch_params.get_launch_request(); @@ -268,11 +268,11 @@ mod tests { launch_request, LaunchRequest { app_id: "test_app".to_string(), - intent: Some(NavigationIntent::NavigationIntentStrict( + intent: Some(NavigationIntent::NavigationIntentStrict(Box::new( NavigationIntentStrict::Home(HomeIntent { context: DiscoveryContext::new("voice", None), }), - )), + ))), } ); } @@ -304,14 +304,14 @@ mod tests { LifecycleManagementEventRequest::Launch(LifecycleManagementLaunchEvent { parameters: LifecycleManagementLaunchParameters { app_id: "example_app".to_string(), - intent: Some(InternalNavigationIntent::NavigationIntentStrict( + intent: Some(InternalNavigationIntent::NavigationIntentStrict(Box::new( InternalNavigationIntentStrict::Home(HomeIntent { context: DiscoveryContext { source: "test_source".to_string(), age_policy: None, }, }), - )), + ))), }, }); let contract_type: RippleContract = RippleContract::Launcher; diff --git a/core/sdk/src/api/firebolt/provider.rs b/core/sdk/src/api/firebolt/provider.rs index d8437a855..1cfcaec01 100644 --- a/core/sdk/src/api/firebolt/provider.rs +++ b/core/sdk/src/api/firebolt/provider.rs @@ -75,7 +75,7 @@ pub enum ProviderResponsePayload { GenericError(GenericProviderError), PinChallengeResponse(PinChallengeResponse), KeyboardResult(KeyboardSessionResponse), - EntityInfoResponse(Option), + EntityInfoResponse(Box>), PurchasedContentResponse(PurchasedContentResult), GenericResponse(serde_json::Value), } @@ -109,7 +109,7 @@ impl ProviderResponsePayload { pub fn as_entity_info_result(&self) -> Option> { match self { - ProviderResponsePayload::EntityInfoResponse(res) => Some(res.clone()), + ProviderResponsePayload::EntityInfoResponse(res) => Some((**res).clone()), _ => None, } } @@ -129,7 +129,9 @@ impl ProviderResponsePayload { serde_json::to_value(res).unwrap() } ProviderResponsePayload::KeyboardResult(res) => serde_json::to_value(res).unwrap(), - ProviderResponsePayload::EntityInfoResponse(res) => serde_json::to_value(res).unwrap(), + ProviderResponsePayload::EntityInfoResponse(res) => { + serde_json::to_value(res.clone()).unwrap() + } ProviderResponsePayload::PurchasedContentResponse(res) => { serde_json::to_value(res).unwrap() } @@ -341,11 +343,12 @@ mod tests { audio_descriptions: Some(vec!["en".to_string()]), }]), }; - let response = ProviderResponsePayload::EntityInfoResponse(Some(EntityInfoResult { - expires: "expires".to_string(), - entity: entity_info.clone(), - related: None, - })); + let response = + ProviderResponsePayload::EntityInfoResponse(Box::new(Some(EntityInfoResult { + expires: "expires".to_string(), + entity: entity_info.clone(), + related: None, + }))); assert_eq!( response.as_entity_info_result(), Some(Some(EntityInfoResult { diff --git a/core/sdk/src/api/manifest/app_library.rs b/core/sdk/src/api/manifest/app_library.rs index b4d452c79..d8790ff8f 100644 --- a/core/sdk/src/api/manifest/app_library.rs +++ b/core/sdk/src/api/manifest/app_library.rs @@ -86,7 +86,7 @@ impl AppLibrary { error!("Local manifests not supported yet"); None } - AppManifestLoad::Embedded(manifest) => Some(manifest.clone()), + AppManifestLoad::Embedded(manifest) => Some((**manifest).clone()), } } @@ -123,12 +123,12 @@ mod tests { AppLibraryEntry { app_id: "app1".to_string(), boot_state: BootState::Foreground, - manifest: AppManifestLoad::Embedded(AppManifest::default()), + manifest: AppManifestLoad::Embedded(Box::default()), }, AppLibraryEntry { app_id: "app2".to_string(), boot_state: BootState::Unloaded, - manifest: AppManifestLoad::Embedded(AppManifest::default()), + manifest: AppManifestLoad::Embedded(Box::default()), }, ] } @@ -161,7 +161,7 @@ mod tests { Some(AppLibraryEntry { app_id: "app1".to_string(), boot_state: BootState::Foreground, - manifest: AppManifestLoad::Embedded(AppManifest::default()), + manifest: AppManifestLoad::Embedded(Box::default()), }) ); } diff --git a/core/sdk/src/api/manifest/device_manifest.rs b/core/sdk/src/api/manifest/device_manifest.rs index 2ff1aacb6..a7f09456b 100644 --- a/core/sdk/src/api/manifest/device_manifest.rs +++ b/core/sdk/src/api/manifest/device_manifest.rs @@ -288,7 +288,7 @@ pub struct AppLibraryEntry { pub enum AppManifestLoad { Remote(String), Local(String), - Embedded(AppManifest), + Embedded(Box), } #[derive(Serialize, Deserialize, Debug, Clone)] diff --git a/core/sdk/src/extn/extn_client_message.rs b/core/sdk/src/extn/extn_client_message.rs index ebb2a9685..6433bb0b6 100644 --- a/core/sdk/src/extn/extn_client_message.rs +++ b/core/sdk/src/extn/extn_client_message.rs @@ -493,7 +493,7 @@ pub enum ExtnResponse { StorageData(StorageData), NetworkResponse(NetworkResponse), TimezoneWithOffset(String, i64), - DefaultApp(AppLibraryEntry), + DefaultApp(Box), Settings(HashMap), BoolMap(HashMap), } From e28a3e260033f20b67dde32208156a8d95701eb6 Mon Sep 17 00:00:00 2001 From: brendanobra Date: Fri, 7 Nov 2025 12:38:06 -0800 Subject: [PATCH 2/2] test: Demo auto-PR creation from parent repo --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f35f59a30..2c0f458d4 100644 --- a/README.md +++ b/README.md @@ -152,3 +152,4 @@ Breakdown the big Ripple monolith into smaller runtime extensions using a standa ## Further Reading [How-to](./docs/how-to.md) +# Test change for pre-push hook demo