Skip to content

Commit f7319b3

Browse files
committed
FIX: Use pub(crate) methods instead of internal trait for Layout
(This is just a remainder from before pub(crate) was a feature we could use)
1 parent 739dd6a commit f7319b3

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

src/layout/layoutfmt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// except according to those terms.
88

99
use super::Layout;
10-
use super::LayoutPriv;
1110

1211
const LAYOUT_NAMES: &[&str] = &["C", "F"];
1312

src/layout/mod.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
mod layoutfmt;
22

3-
// public but users don't interact with it
3+
// public struct but users don't interact with it
44
#[doc(hidden)]
55
/// Memory layout description
66
#[derive(Copy, Clone)]
77
pub struct Layout(u32);
88

9-
pub trait LayoutPriv: Sized {
10-
fn new(x: u32) -> Self;
11-
fn and(self, flag: Self) -> Self;
12-
fn is(self, flag: u32) -> bool;
13-
fn flag(self) -> u32;
14-
}
15-
16-
impl LayoutPriv for Layout {
9+
impl Layout {
1710
#[inline(always)]
18-
fn new(x: u32) -> Self {
11+
pub(crate) fn new(x: u32) -> Self {
1912
Layout(x)
2013
}
2114

2215
#[inline(always)]
23-
fn is(self, flag: u32) -> bool {
16+
pub(crate) fn is(self, flag: u32) -> bool {
2417
self.0 & flag != 0
2518
}
2619
#[inline(always)]
27-
fn and(self, flag: Layout) -> Layout {
20+
pub(crate) fn and(self, flag: Layout) -> Layout {
2821
Layout(self.0 & flag.0)
2922
}
3023

3124
#[inline(always)]
32-
fn flag(self) -> u32 {
25+
pub(crate) fn flag(self) -> u32 {
3326
self.0
3427
}
3528
}

src/zip/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use crate::Layout;
1818
use crate::NdIndex;
1919

2020
use crate::indexes::{indices, Indices};
21-
use crate::layout::LayoutPriv;
2221
use crate::layout::{CORDER, FORDER};
2322

2423
/// Return if the expression is a break value.

0 commit comments

Comments
 (0)