Skip to content

Commit

Permalink
chore(crate): Delegate French lower, upper, and sentence case to English
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Oct 27, 2024
1 parent c008a5b commit e7086ee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/fr.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
// SPDX-FileCopyrightText: © 2023 Caleb Maclennan <caleb@alerque.com>
// SPDX-License-Identifier: LGPL-3.0-only

use crate::{Chunk, StyleGuide};
use crate::content::{Chunk, Segment};

Check failure on line 4 in src/fr.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `Segment`

error: unused import: `Segment` --> src/fr.rs:4:29 | 4 | use crate::content::{Chunk, Segment}; | ^^^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]`

Check warning on line 4 in src/fr.rs

View workflow job for this annotation

GitHub Actions / test

unused import: `Segment`
use crate::types::StyleGuide;

pub fn titlecase(_chunk: Chunk, _style: StyleGuide) -> String {
todo!();
}

pub fn lowercase(_chunk: Chunk) -> String {
todo!();
}
pub use crate::en::lowercase;
pub use crate::en::sentencecase;
pub use crate::en::uppercase;

pub fn uppercase(_chunk: Chunk) -> String {
todo!();
}

pub fn sentencecase(_chunk: Chunk) -> String {
pub fn titlecase(_chunk: Chunk, _style: StyleGuide) -> String {
todo!();
}
11 changes: 11 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ macro_rules! lowercase {

lowercase!(lower_en, Locale::EN, "foo BAR BaZ BIKE", "foo bar baz bike");

lowercase!(lower_fr, Locale::FR, "foo BAR BaZ BIKE", "foo bar baz bike");

lowercase!(
lower_tr,
Locale::TR,
Expand All @@ -226,6 +228,8 @@ macro_rules! uppercase {

uppercase!(upper_en, Locale::EN, "foo BAR BaZ bike", "FOO BAR BAZ BIKE");

uppercase!(upper_fr, Locale::FR, "foo BAR BaZ bike", "FOO BAR BAZ BIKE");

uppercase!(
upper_tr,
Locale::TR,
Expand All @@ -250,4 +254,11 @@ sentencecase!(
"Insert bike here"
);

sentencecase!(
sentence_fr,
Locale::FR,
"insert BIKE here",
"Insert bike here"
);

sentencecase!(sentence_tr, Locale::TR, "ilk DAVRANSIN", "İlk davransın");

0 comments on commit e7086ee

Please sign in to comment.