Refactor: delete russian comments
This commit is contained in:
parent
52389736a0
commit
5217b437e1
3 changed files with 2 additions and 10 deletions
|
|
@ -60,7 +60,7 @@ pub fn save_config(cfg: &Config) -> Result<(), ConfigError> {
|
|||
{
|
||||
let mut tmp = File::create(&tmp_path)?;
|
||||
tmp.write_all(content.as_bytes())?;
|
||||
tmp.sync_all()?; // опционально: гарантирует запись на диск
|
||||
tmp.sync_all()?;
|
||||
}
|
||||
std::fs::rename(tmp_path, path)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ fn has_unpushed_commits_to_upstream(
|
|||
repo: &Repository,
|
||||
upstream_refname: &str,
|
||||
) -> Result<bool, Error> {
|
||||
// refs/heads/<local> vs refs/remotes/<remote>/<branch> expected in upstream_refname
|
||||
let head = repo.head()?;
|
||||
let local_oid = head
|
||||
.target()
|
||||
|
|
@ -72,7 +71,7 @@ fn has_unpushed_commits_to_upstream(
|
|||
let mut revwalk = repo.revwalk()?;
|
||||
revwalk.push(local_oid)?;
|
||||
revwalk.hide(upstream_oid)?;
|
||||
// если есть хотя бы один коммит, значит есть непушеные
|
||||
|
||||
Ok(revwalk.into_iter().next().is_some())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,20 +18,15 @@ pub fn run_timer(total_conc_mins: u8, total_rest_mins: u8) -> Result<(), Error>
|
|||
let mut stdout = stdout();
|
||||
execute!(stdout, terminal::EnterAlternateScreen, cursor::Hide)?;
|
||||
|
||||
// Запускаем таймерный поток
|
||||
let timer_handle = start_timer_thread(timer.clone());
|
||||
|
||||
// Главный цикл: отрисовка + обработка событий
|
||||
loop {
|
||||
// Рендеринг одного кадра
|
||||
render_screen(&mut stdout, &timer)?;
|
||||
|
||||
// Если кто-то уже поставил running = false — выходим
|
||||
if timer.get_status() == TimerStatus::Ended {
|
||||
break;
|
||||
}
|
||||
|
||||
// Обработка событий с таймаутом
|
||||
if event::poll(Duration::from_millis(200))? {
|
||||
if let Event::Key(key_ev) = event::read()? {
|
||||
match key_ev.code {
|
||||
|
|
@ -55,14 +50,12 @@ pub fn run_timer(total_conc_mins: u8, total_rest_mins: u8) -> Result<(), Error>
|
|||
}
|
||||
}
|
||||
|
||||
// Гарантируем остановку таймерного потока и дождаться join
|
||||
{
|
||||
timer.set_status(TimerStatus::Ended);
|
||||
}
|
||||
|
||||
let _ = timer_handle.join();
|
||||
|
||||
// Финальный экран и ожидание нажатия клавиши
|
||||
render_screen(&mut stdout, &timer)?;
|
||||
loop {
|
||||
if event::poll(Duration::from_millis(200))? {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue