mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
Simplify some Option / Result / ? operator patterns (#8653)
* Simplify some Option / Result / ? operator patterns When those match a combinator exactly. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust). * adjust after review * adjust post-review
This commit is contained in:
committed by
GitHub
parent
541692c4a8
commit
052be8bbef
@@ -389,10 +389,7 @@ impl Telemetry {
|
||||
/// The `connection_message` argument is a JSON object that is sent every time the connection
|
||||
/// (re-)establishes.
|
||||
pub fn start_telemetry(&mut self, connection_message: ConnectionMessage) -> Result<()> {
|
||||
let endpoints = match self.endpoints.take() {
|
||||
Some(x) => x,
|
||||
None => return Err(Error::TelemetryAlreadyInitialized),
|
||||
};
|
||||
let endpoints = self.endpoints.take().ok_or_else(|| Error::TelemetryAlreadyInitialized)?;
|
||||
|
||||
self.register_sender
|
||||
.unbounded_send(Register::Telemetry {
|
||||
|
||||
Reference in New Issue
Block a user