Skip to content

Commit c0a1158

Browse files
committed
Move the description module out of matcher_support.
Currently `description::Description` is in `matcher_support` because it facilitates writing matchers but is not a required part of the interface. In the future, the return types of `Matcher::describe` and `Matcher::explain_match` will be changed to `description::Description`, making it an essential part of the interface rather than a mere support mechanism. Thus it makes sense to put it in the root module rather than in `matcher_support`.
1 parent dd5e9a6 commit c0a1158

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

googletest/src/matcher_support/description.rs renamed to googletest/src/description.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl Description {
8383
///
8484
/// ```
8585
/// # use googletest::prelude::*;
86-
/// # use googletest::matcher_support::description::Description;
86+
/// # use googletest::description::Description;
8787
/// let description = std::iter::once("A B C\nD E F".to_string()).collect::<Description>();
8888
/// verify_that!(description.indent(), displays_as(eq(" A B C\n D E F")))
8989
/// # .unwrap();
@@ -103,7 +103,7 @@ impl Description {
103103
///
104104
/// ```
105105
/// # use googletest::prelude::*;
106-
/// # use googletest::matcher_support::description::Description;
106+
/// # use googletest::description::Description;
107107
/// let description = std::iter::once("A B C\nD E F".to_string()).collect::<Description>();
108108
/// verify_that!(description.indent_except_first_line(), displays_as(eq("A B C\n D E F")))
109109
/// # .unwrap();
@@ -123,7 +123,7 @@ impl Description {
123123
///
124124
/// ```
125125
/// # use googletest::prelude::*;
126-
/// # use googletest::matcher_support::description::Description;
126+
/// # use googletest::description::Description;
127127
/// let description = std::iter::once("A B C\nD E F".to_string()).collect::<Description>();
128128
/// verify_that!(description.bullet_list(), displays_as(eq("* A B C\n D E F")))
129129
/// # .unwrap();
@@ -143,7 +143,7 @@ impl Description {
143143
///
144144
/// ```
145145
/// # use googletest::prelude::*;
146-
/// # use googletest::matcher_support::description::Description;
146+
/// # use googletest::description::Description;
147147
/// let description = std::iter::once("A B C\nD E F".to_string()).collect::<Description>();
148148
/// verify_that!(description.enumerate(), displays_as(eq("0. A B C\n D E F")))
149149
/// # .unwrap();

googletest/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extern crate quickcheck;
2121

2222
#[macro_use]
2323
pub mod assertions;
24+
pub mod description;
2425
pub mod internal;
2526
pub mod matcher;
2627
pub mod matcher_support;

googletest/src/matcher_support/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
//! matchers.
2020
2121
pub(crate) mod count_elements;
22-
pub mod description;
2322
pub(crate) mod edit_distance;
2423
pub(crate) mod summarize_diff;
2524
pub(crate) mod zipped_iterator;

googletest/src/matchers/all_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ macro_rules! __all {
6464
/// For internal use only. API stablility is not guaranteed!
6565
#[doc(hidden)]
6666
pub mod internal {
67+
use crate::description::Description;
6768
use crate::matcher::{Matcher, MatcherResult};
68-
use crate::matcher_support::description::Description;
6969
use crate::matchers::anything;
7070
use std::fmt::Debug;
7171

googletest/src/matchers/any_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ macro_rules! __any {
6666
/// For internal use only. API stablility is not guaranteed!
6767
#[doc(hidden)]
6868
pub mod internal {
69+
use crate::description::Description;
6970
use crate::matcher::{Matcher, MatcherResult};
70-
use crate::matcher_support::description::Description;
7171
use crate::matchers::anything;
7272
use std::fmt::Debug;
7373

googletest/src/matchers/each_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use crate::description::Description;
1516
use crate::matcher::{Matcher, MatcherResult};
16-
use crate::matcher_support::description::Description;
1717
use std::{fmt::Debug, marker::PhantomData};
1818

1919
/// Matches a container all of whose elements are matched by the matcher

googletest/src/matchers/elements_are_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ macro_rules! __elements_are {
9292
/// **For internal use only. API stablility is not guaranteed!**
9393
#[doc(hidden)]
9494
pub mod internal {
95+
use crate::description::Description;
9596
use crate::matcher::{Matcher, MatcherResult};
96-
use crate::matcher_support::description::Description;
9797
use crate::matcher_support::zipped_iterator::zip;
9898
use std::{fmt::Debug, marker::PhantomData};
9999

googletest/src/matchers/pointwise_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ macro_rules! __pointwise {
151151
/// **For internal use only. API stablility is not guaranteed!**
152152
#[doc(hidden)]
153153
pub mod internal {
154+
use crate::description::Description;
154155
use crate::matcher::{Matcher, MatcherResult};
155-
use crate::matcher_support::description::Description;
156156
use crate::matcher_support::zipped_iterator::zip;
157157
use std::{fmt::Debug, marker::PhantomData};
158158

googletest/src/matchers/unordered_elements_are_matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ macro_rules! __is_contained_in {
365365
/// **For internal use only. API stablility is not guaranteed!**
366366
#[doc(hidden)]
367367
pub mod internal {
368+
use crate::description::Description;
368369
use crate::matcher::{Matcher, MatcherResult};
369370
use crate::matcher_support::count_elements::count_elements;
370-
use crate::matcher_support::description::Description;
371371
use std::collections::HashSet;
372372
use std::fmt::{Debug, Display};
373373
use std::marker::PhantomData;

0 commit comments

Comments
 (0)