Skip to content

Commit

Permalink
fix: Do not pub use Action
Browse files Browse the repository at this point in the history
Confusing, as there's been two ways of importing used throughout the
code until now. Make it just one.
  • Loading branch information
alexpovel committed Oct 7, 2023
1 parent a964ff1 commit 1e2c663
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 29 deletions.
18 changes: 9 additions & 9 deletions src/actions/german/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use unicode_titlecase::StrTitleCase;
/// # Example: A simple greeting, with Umlaut and Eszett
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// let action = German::default();
/// let result = action.act("Gruess Gott!");
Expand All @@ -48,7 +48,7 @@ use unicode_titlecase::StrTitleCase;
/// *elaborate* word list!), but is still handled, as its constituents are.
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// let action = German::default();
/// let result = action.act("Du Suesswassertagtraeumer!");
Expand All @@ -62,7 +62,7 @@ use unicode_titlecase::StrTitleCase;
/// [`tr`](https://en.wikipedia.org/wiki/Tr_(Unix))) would not handle this correctly.
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// for word in &[
/// // "ae"
Expand Down Expand Up @@ -116,7 +116,7 @@ use unicode_titlecase::StrTitleCase;
///
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// let action = German::default();
/// let result = action.act("aEpFeL");
Expand All @@ -133,7 +133,7 @@ use unicode_titlecase::StrTitleCase;
/// output is `Äpfel`
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// let action = German::default();
/// let result: String = action.act("AePfEl");
Expand All @@ -145,7 +145,7 @@ use unicode_titlecase::StrTitleCase;
/// ## Subexample: other cases
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// let action = German::default();
/// let f = |word: &str| -> String {action.act(word)};
Expand Down Expand Up @@ -212,7 +212,7 @@ use unicode_titlecase::StrTitleCase;
/// ([`str`]).
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// let action = German::default();
/// let result = action.act("\0Schoener 你好 Satz... 👋🏻\r\n\n");
Expand Down Expand Up @@ -294,7 +294,7 @@ impl German {
/// much more likely than for Umlauts.
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// for (original, output) in &[
/// ("Busse", "Buße"), // busses / penance
Expand All @@ -317,7 +317,7 @@ impl German {
/// Naive mode is essentially forcing a maximum number of replacements.
///
/// ```
/// use srgn::{Action, actions::German};
/// use srgn::actions::{Action, German};
///
/// for (original, output) in &[
/// ("Frau Schroekedaek", "Frau Schrökedäk"), // Names are not in the word list
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![allow(missing_docs)]
#![allow(clippy::module_name_repetitions)]

pub use crate::actions::Action;
use crate::actions::Action;
use crate::scoping::ScopedViewBuilder;
use log::debug;
use scoping::ScopedViewBuildStep;
Expand Down Expand Up @@ -43,7 +43,7 @@ pub use fancy_regex::Regex as RegexPattern;
///
///
/// ```
/// use srgn::{apply, scoping::{ScopedViewBuildStep, regex::Regex}, actions::German, Action};
/// use srgn::{apply, scoping::{ScopedViewBuildStep, regex::Regex}, actions::{Action, German}};
///
/// let actions: &[Box<dyn Action>] = &[Box::new(German::default())];
/// let scopers: &[Box<dyn ScopedViewBuildStep>] = &[Box::new(Regex::default())];
Expand Down
20 changes: 12 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ use srgn::actions::Titlecase;
use srgn::actions::Upper;
#[cfg(feature = "symbols")]
use srgn::actions::{Symbols, SymbolsInversion};
use srgn::scoping::{
langs::{
csharp::{CSharp, CSharpQuery},
python::{Python, PythonQuery},
typescript::{TypeScript, TypeScriptQuery},
use srgn::{
actions::Action,
apply,
scoping::{
langs::{
csharp::{CSharp, CSharpQuery},
python::{Python, PythonQuery},
typescript::{TypeScript, TypeScriptQuery},
},
literal::Literal,
regex::Regex,
ScopedViewBuildStep, ScoperBuildError,
},
literal::Literal,
ScopedViewBuildStep, ScoperBuildError,
};
use srgn::{apply, scoping::regex::Regex, Action};
use std::io::{self, Error, Read, Write};

fn main() -> Result<(), Error> {
Expand Down
3 changes: 1 addition & 2 deletions tests/properties/lower.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::properties::DEFAULT_NUMBER_OF_TEST_CASES;
use proptest::prelude::*;
use srgn::{
actions::{Action, Lower},
scoping::ScopedViewBuilder,
};

use crate::properties::DEFAULT_NUMBER_OF_TEST_CASES;

proptest! {
#![proptest_config(ProptestConfig::with_cases(DEFAULT_NUMBER_OF_TEST_CASES))]
#[test]
Expand Down
4 changes: 2 additions & 2 deletions tests/properties/squeeze.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use proptest::prelude::*;
use srgn::{
actions::Squeeze,
actions::{Action, Squeeze},
scoping::{regex::Regex, ScopedViewBuilder},
Action, RegexPattern,
RegexPattern,
};

use crate::properties::DEFAULT_NUMBER_OF_TEST_CASES;
Expand Down
6 changes: 2 additions & 4 deletions tests/properties/symbols.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use crate::properties::DEFAULT_NUMBER_OF_TEST_CASES;
use proptest::prelude::*;
use srgn::{
actions::{Symbols, SymbolsInversion},
actions::{Action, Symbols, SymbolsInversion},
scoping::ScopedViewBuilder,
Action,
};

use crate::properties::DEFAULT_NUMBER_OF_TEST_CASES;

proptest! {
#![proptest_config(ProptestConfig::with_cases(DEFAULT_NUMBER_OF_TEST_CASES * 2))]
/// Cannot be idempotent on non-ASCII input. Input might contain e.g. en-dash, which
Expand Down
7 changes: 5 additions & 2 deletions tests/properties/upper.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use crate::properties::DEFAULT_NUMBER_OF_TEST_CASES;
use proptest::prelude::*;
use srgn::{actions::Upper, scoping::ScopedViewBuilder, Action};
use srgn::{
actions::{Action, Upper},
scoping::ScopedViewBuilder,
};

use crate::properties::DEFAULT_NUMBER_OF_TEST_CASES;
proptest! {
#![proptest_config(ProptestConfig::with_cases(DEFAULT_NUMBER_OF_TEST_CASES))]
#[test]
Expand Down

0 comments on commit 1e2c663

Please sign in to comment.