Migrate to String::new()

This commit is contained in:
micialware committed 2026-09-20 22:24:42 +03:00
1 parent 1d4b37e381
commit a5526dc5e9
8 files changed
+19 -19

No files matched your search

+2 -2
View File
@@ -133,8 +133,8 @@ impl DeckSettings {
DeckSettings {
id: 0.into(),
name,
forward: "".to_string(),
backward: "".to_string(),
forward: String::new(),
backward: String::new(),
filter: "true".to_string(),
}
}
+2 -2
View File
@@ -413,7 +413,7 @@ impl DictionaryState {
tag_map: HashMap::new(),
words_tags: vec![],
reverse: false,
search: "".to_string(),
search: String::new(),
no_typing: true,
reverse_list: true,
auto_save_queue: HashMap::new(),
@@ -717,7 +717,7 @@ impl DictionaryState {
}
fn selection_editor(&self) -> iced::Element<'_, DictionaryMessage> {
let mut display = "".to_string();
let mut display = String::new();
let mut editable = false;
if let Some(selected) = self.selected_cell.as_ref() {
let mut dictionary = self.state.dictionary.write();
+2 -2
View File
@@ -114,9 +114,9 @@ impl DictionaryQuizState {
state,
words,
current_set: Vec::new(),
answer: "".to_string(),
answer: String::new(),
view: "---".to_string(),
correct: "".to_string(),
correct: String::new(),
score: Default::default(),
is_help: false,
reverse,
+2 -2
View File
@@ -57,8 +57,8 @@ impl HistoryState {
id: Default::default(),
group_id: Default::default(),
key: "Удаленное слово".to_string(),
value: "".to_string(),
tags: "".to_string(),
value: String::new(),
tags: String::new(),
additional: Default::default(),
});
(word, item.clone())
+1 -1
View File
@@ -329,7 +329,7 @@ impl ImportState {
import_data: None,
selected_index: 0,
selected_property: None,
custom_property_name: "".to_string(),
custom_property_name: String::new(),
skip_empty: true,
separator: ", ".to_string(),
progress: None,
+1 -1
View File
@@ -113,7 +113,7 @@ impl QuizState {
kana: "ぁ".to_string(),
correct_roman: "a".to_string(),
is_help: false,
current_roman: "".to_string(),
current_roman: String::new(),
set: KanaSet::hiragana(),
queue: Vec::new(),
score: Score {
+3 -3
View File
@@ -7,7 +7,7 @@ use crate::pages::word::WordMessage::*;
use crate::styling::*;
use iced::widget::button::danger;
use iced::widget::space::horizontal;
use iced::widget::{button, column, row, rule, scrollable, text, text_input};
use iced::widget::{button, column, row, rule, scrollable, text};
use iced::{Element, Fill};
use iced_core::Padding;
@@ -35,10 +35,10 @@ impl<Message> WordEditor<Message> {
word.value = n;
}
SetAdditional(key, value) => {
word.additional.insert(key, value.clone());
word.additional.insert(key, value.replace("", ""));
}
AddAdditional(key) => {
word.additional.insert(key, "".to_string());
word.additional.insert(key, String::new());
}
RemoveAdditional(key) => {
word.additional.remove(&key);
+6 -6
View File
@@ -65,11 +65,11 @@ impl WritingState {
let mut list = set.list();
list.shuffle(&mut rand::rng());
WritingState {
kana: "".to_string(),
kana: String::new(),
set: list.clone(),
original_set: list,
kana_total: "".to_string(),
roman_total: "".to_string(),
kana_total: String::new(),
roman_total: String::new(),
next_text: "Дальше".to_string(),
show_all: false,
}
@@ -79,9 +79,9 @@ impl WritingState {
impl WritingState {
fn next(&mut self) {
if self.set.is_empty() {
self.kana = "".to_string();
self.roman_total = "".to_string();
self.kana_total = "".to_string();
self.kana = String::new();
self.roman_total = String::new();
self.kana_total = String::new();
self.set = self.original_set.clone();
self.set.shuffle(&mut rand::rng());