Refactor relationship type retrieval in character workers: Simplify the extraction of relationship types in CharacterCreationWorker, EventsWorker, and UserCharacterWorker by streamlining the use of and_then for better readability and maintainability.

This commit is contained in:
Torsten Schulz (local)
2026-01-23 10:48:15 +01:00
parent 0399333163
commit c8668c59eb
3 changed files with 3 additions and 8 deletions

View File

@@ -3,7 +3,6 @@ use crate::message_broker::MessageBroker;
use rand::distributions::{Distribution, Uniform};
use rand::rngs::StdRng;
use rand::{thread_rng, Rng, SeedableRng};
use serde_json::json;
use std::collections::{HashMap, HashSet};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
@@ -437,8 +436,7 @@ impl CharacterCreationWorker {
.and_then(|v| v.parse::<i32>().ok());
let relationship_type_tr = row
.get("relationship_type_tr")
.and_then(|v| v.as_str())
.map(|s| s.to_string());
.and_then(|v| v.as_str().map(|s| s.to_string()));
// Logging: Relationship wurde gelöscht
eprintln!(