Skip to content

Commit debaa77

Browse files
committed
chore(lint): items no other crate can reach are no longer pub
1 parent e99cc0e commit debaa77

14 files changed

Lines changed: 31 additions & 22 deletions

File tree

‎Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ version = "0.1.0"
2828
[workspace.lints.rust]
2929
unsafe_code = "forbid"
3030
missing_docs = "warn"
31+
unreachable_pub = "warn"
3132

3233
# Every Clippy warning fails CI: `just rust lint` runs Clippy with `-D warnings`.
3334
# The groups sit at priority -1 so the single lints below can override them.

‎apps/auth-service/src/admin/overview/mod.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Kinds {
3131
/// How often something happened in the last hour, against an hour's usual
3232
/// count over the last week.
3333
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
34-
pub struct Rate {
34+
pub(crate) struct Rate {
3535
/// In the last hour.
3636
pub last_hour: u64,
3737
/// Per hour, averaged over the week before, rounded up.
@@ -58,7 +58,7 @@ impl Rate {
5858

5959
/// What needs an administrator's attention.
6060
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
61-
pub enum Problem {
61+
pub(crate) enum Problem {
6262
/// Alerts are open: nobody posted an update on them yet.
6363
OpenAlerts(u64),
6464
/// Far more sign-ins failed in the last hour than usually do.
@@ -74,7 +74,7 @@ pub enum Problem {
7474

7575
/// What the overview shows.
7676
#[derive(Clone, Debug)]
77-
pub struct Overview {
77+
pub(crate) struct Overview {
7878
/// Rejected passkey and provider authentications.
7979
pub failed_sign_ins: Rate,
8080
/// Browsers signing in.
@@ -102,7 +102,7 @@ pub struct Overview {
102102
impl Overview {
103103
/// What needs attention, most pressing first.
104104
#[must_use]
105-
pub fn problems(&self) -> Vec<Problem> {
105+
pub(crate) fn problems(&self) -> Vec<Problem> {
106106
let mut problems = Vec::new();
107107
if self.open_alerts > 0 {
108108
problems.push(Problem::OpenAlerts(self.open_alerts));

‎apps/auth-service/src/admin/types/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const DEFAULT_GRACE_PERIOD: i64 = MINUTES_PER_DAY;
4848

4949
/// A whole number of minutes, written in its largest whole unit, e.g. `365d`.
5050
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
51-
pub struct Minutes(i64);
51+
pub(crate) struct Minutes(i64);
5252

5353
impl fmt::Display for Minutes {
5454
/// Writes `0`, or the number of days, hours or minutes with its unit.

‎apps/auth-service/src/federation/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use url::Url;
3535
mod error;
3636
/// Pending evidence, signup attachment, linking and unlinking.
3737
mod identities;
38-
pub use error::FederationConfigError;
38+
pub(crate) use error::FederationConfigError;
3939
pub(crate) use error::FederationError;
4040
use error::InvalidReturnTo;
4141
pub(crate) use identities::{PendingKind, PendingView};

‎apps/auth-service/src/oidc/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(crate) use authorize::{
2222
AuthorizationDecision, AuthorizationView, RecoveryQuestion, TransactionQuery,
2323
};
2424
use error::Challenge;
25-
pub use error::OidcConfigError;
25+
pub(crate) use error::OidcConfigError;
2626
pub(crate) use error::{OAuthCode, OAuthError, Reject};
2727
pub(crate) use inline::{InlineClaim, InlineResponse};
2828
pub(crate) use logout::{LogoutQuery, LogoutView};

‎apps/auth-service/src/passkey/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ mod settings;
4848
mod types;
4949

5050
pub(crate) use confirmation::AdminProof;
51-
pub use error::PasskeyConfigError;
51+
pub(crate) use error::PasskeyConfigError;
5252
pub(crate) use error::PasskeyError;
5353
pub(crate) use recovery::VerifiedRecoveryUndo;
5454
use types::PasskeyKind;

‎crates/auth-sdk/src/scope.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ macro_rules! scopes {
148148
#[doc = ""]
149149
$(#[$scope_meta])*
150150
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
151-
pub enum $scope {}
151+
pub(crate) enum $scope {}
152152

153153
impl $crate::Scope for $scope {
154154
const NAME: &'static str = $name;
@@ -166,7 +166,7 @@ macro_rules! scopes {
166166

167167
/// Every scope this module declares.
168168
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
169-
pub enum All {}
169+
pub(crate) enum All {}
170170

171171
impl $crate::__private::Declared for All {
172172
const NAMES: &'static [&'static str] = &[$($name),+];

‎crates/common/src/tests.rs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//! Focused tests for exported vocabulary expansion and identifier syntax.
2+
#![expect(
3+
unreachable_pub,
4+
reason = "The vocabulary macros make their items public, which a test-private enum cannot reach."
5+
)]
6+
27
use super::*;
38

49
str_enum! {

‎crates/ui/src/layout/frames.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use topcoat::{
1212
pub const SOURCE: &str = "https://github.com/sourceorigin-dev/sourceorigin";
1313

1414
/// Where SourceOrigin's users and developers write to.
15-
pub const SUPPORT_ADDRESS: &str = "support@sourceorigin.dev";
15+
pub(crate) const SUPPORT_ADDRESS: &str = "support@sourceorigin.dev";
1616

1717
/// Where every page's footer links SourceOrigin's policies, which sourceorigin.dev serves.
1818
#[derive(Clone, Copy, Debug, PartialEq, Eq)]

‎crates/ui/src/layout/mod.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ pub use html::{PreferenceChange, Preferences, Sidebar, Theme, Title, document};
2525
pub use parts::{Pager, page_head};
2626
pub use search::{Destination, Group, Search, SearchPage, search_results};
2727
pub use sections::{AccountNav, Section, account, signed_out};
28-
pub use signed_in::{
29-
Crumb, NavGroup, NavItem, PasskeySignal, Shell, Shortcut, ShortcutKind, Who, shell,
30-
};
28+
pub use signed_in::{Crumb, PasskeySignal, Shortcut, ShortcutKind, Who, shell};
3129

3230
pub(crate) use parts::{
3331
Label, alert_notice, announcement_text, dialog, navigation, page_messages, pager,
3432
private_address,
3533
};
3634
pub(crate) use search::{Searchable, Spot};
3735
pub(crate) use signed_in::{AvatarSize, avatar};
36+
pub(crate) use signed_in::{NavGroup, NavItem, Shell};

0 commit comments

Comments
 (0)