Skip to content

Commit f410a3f

Browse files
committed
Reformat source
1 parent e55f3a4 commit f410a3f

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/config/lesson.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ pub struct LessonPage {
2020
pub content2: String,
2121
}
2222

23-
2423
#[derive(Debug, Default, Clone, Deserialize)]
2524
pub struct Lesson {
2625
pub pages: Vec<LessonPage>,
2726
}
2827

2928
impl Lesson {
3029
pub fn load(path: PathBuf) -> Result<Self, Error> {
31-
let content = fs::read_to_string(path.clone()).map_err(|e| Error::Read(path.display().to_string(), e.to_string()))?;
30+
let content = fs::read_to_string(path.clone())
31+
.map_err(|e| Error::Read(path.display().to_string(), e.to_string()))?;
3232
let lesson: Lesson =
3333
serde_yaml::from_str(&content).map_err(|e| Error::Parse(e.to_string()))?;
3434
Ok(lesson)

src/environment.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ pub fn data_dir() -> PathBuf {
1111
}
1212

1313
pub fn platform_specific_config_dir() -> PathBuf {
14-
dirs_next::config_dir().expect("Cannot find valid configuration directory").join("raiti")
14+
dirs_next::config_dir()
15+
.expect("Cannot find valid configuration directory")
16+
.join("raiti")
1517
}
1618

1719
/// Checks if a config file exists in the same directory as the executable.
@@ -24,4 +26,4 @@ fn portable_dir() -> Option<PathBuf> {
2426
dir.join(CONFIG_FILE_NAME)
2527
.is_file()
2628
.then(|| dir.to_path_buf())
27-
}
29+
}

src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ impl Raiti {
7070
Config::data_dir()
7171
.join("keyboards")
7272
.join(format!("{}.yaml", &config.current_keyboard)),
73-
).expect("Error loading keyboard config");
74-
73+
)
74+
.expect("Error loading keyboard config");
7575

7676
(
7777
Self {
@@ -246,7 +246,9 @@ impl Raiti {
246246
if let Some(page) = self.config.get_page() {
247247
if !page.show_keys.is_empty() {
248248
self.keyboard
249-
.update(keyboard_component::Message::SetShowKeys(page.show_keys.clone()))
249+
.update(keyboard_component::Message::SetShowKeys(
250+
page.show_keys.clone(),
251+
))
250252
}
251253
}
252254
if let Some(ex) = self.config.get_exercise() {

0 commit comments

Comments
 (0)