remove unused service_id (#4)

This commit is contained in:
Giacomo Pasini 2022-10-27 16:09:39 +02:00 committed by GitHub
parent bc771e21ca
commit 6362735d44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -17,8 +17,6 @@ use crate::services::{ServiceCore, ServiceId, ServiceState};
/// Service handle
/// This is used to access different parts of the service
pub struct ServiceHandle<S: ServiceCore> {
/// Service id (must match `<ServiceCore::ServiceId>`)
id: ServiceId,
/// Message channel relay
/// Would be None if service is not running
/// Will contain the channel if service is running
@ -51,13 +49,11 @@ pub struct ServiceRunner<S: ServiceCore> {
impl<S: ServiceCore> ServiceHandle<S> {
pub fn new(settings: S::Settings, overwatch_handle: OverwatchHandle) -> Self {
let id = S::SERVICE_ID;
let initial_state: S::State = S::State::from_settings(&settings);
let settings = SettingsUpdater::new(settings);
Self {
id,
outbound_relay: None,
settings,
initial_state,
@ -67,7 +63,7 @@ impl<S: ServiceCore> ServiceHandle<S> {
}
pub fn id(&self) -> ServiceId {
self.id
S::SERVICE_ID
}
/// Service runtime getter