Skip to content

Commit 71c1e35

Browse files
committed
build: 更新 rust 版本和依赖
Signed-off-by: YdrMaster <[email protected]>
1 parent 217344b commit 71c1e35

File tree

3 files changed

+69
-70
lines changed

3 files changed

+69
-70
lines changed

Cargo.lock

Lines changed: 50 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

llama.cu/src/handle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'ctx> Handle<'ctx> {
3535
}
3636
}
3737

38-
pub fn compile(&mut self, key: Box<[ModuleKey]>, code: impl FnOnce() -> String) -> &Module {
38+
pub fn compile(&mut self, key: Box<[ModuleKey]>, code: impl FnOnce() -> String) -> &Module<'_> {
3939
self.modules.entry(key).or_insert_with(|| {
4040
let program = Rtc::new()
4141
.arch(self.ctx.dev().compute_capability())

xtask/src/chat/tui.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl App {
9898
frame.render_widget(self.state_bar(), bottom);
9999
}
100100

101-
fn sess_list(&self) -> List {
101+
fn sess_list(&self) -> List<'_> {
102102
let mut title = Line::from("sessions").bold();
103103
if self.focus.select() {
104104
title = title.fg(Color::Black).bg(Color::LightBlue);
@@ -144,17 +144,17 @@ impl App {
144144
text.push_str(msg);
145145
text.push('\n')
146146
}
147-
if let State::User = self.state() {
148-
if let Focus::Main(cursor) = &mut self.focus {
149-
let time = Instant::now();
150-
let duration = time.duration_since(*cursor);
151-
if duration < Duration::from_millis(500) {
152-
} else if duration < Duration::from_secs(1) {
153-
text.pop();
154-
text.push('_')
155-
} else {
156-
*cursor = time
157-
}
147+
if let State::User = self.state()
148+
&& let Focus::Main(cursor) = &mut self.focus
149+
{
150+
let time = Instant::now();
151+
let duration = time.duration_since(*cursor);
152+
if duration < Duration::from_millis(500) {
153+
} else if duration < Duration::from_secs(1) {
154+
text.pop();
155+
text.push('_')
156+
} else {
157+
*cursor = time
158158
}
159159
}
160160

@@ -182,7 +182,7 @@ impl App {
182182
frame.render_stateful_widget(scrollbar, area, &mut scrollbar_state);
183183
}
184184

185-
fn state_bar(&self) -> Paragraph {
185+
fn state_bar(&self) -> Paragraph<'_> {
186186
let title = Line::from("state").bold().blue();
187187
let text = format!(
188188
"msgs: {}, pos: {}/{}/{}",
@@ -199,12 +199,11 @@ impl App {
199199
State::User => Duration::from_millis(250),
200200
State::Assistant => Duration::from_millis(5),
201201
};
202-
if event::poll(interval)? {
203-
if let Event::Key(key) = event::read()? {
204-
if key.kind == KeyEventKind::Press {
205-
self.on_key_event(key)
206-
}
207-
}
202+
if event::poll(interval)?
203+
&& let Event::Key(key) = event::read()?
204+
&& key.kind == KeyEventKind::Press
205+
{
206+
self.on_key_event(key)
208207
}
209208
Ok(())
210209
}

0 commit comments

Comments
 (0)