Use read()
over read_with()
to improve readability in simple cases (#31263)
Release Notes: - N/A
This commit is contained in:
parent
e88cad29e5
commit
6206150e27
5 changed files with 11 additions and 18 deletions
|
@ -153,13 +153,10 @@ impl Render for ProfileSelector {
|
|||
.map(|profile| profile.name.clone())
|
||||
.unwrap_or_else(|| "Unknown".into());
|
||||
|
||||
let configured_model = self
|
||||
.thread
|
||||
.read_with(cx, |thread, _cx| thread.configured_model())
|
||||
.or_else(|| {
|
||||
let model_registry = LanguageModelRegistry::read_global(cx);
|
||||
model_registry.default_model()
|
||||
});
|
||||
let configured_model = self.thread.read(cx).configured_model().or_else(|| {
|
||||
let model_registry = LanguageModelRegistry::read_global(cx);
|
||||
model_registry.default_model()
|
||||
});
|
||||
let supports_tools =
|
||||
configured_model.map_or(false, |default| default.model.supports_tools());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue