Skip to content

Commit dcc94a3

Browse files
Clara Rullmeta-codesync[bot]
authored andcommitted
mononoke: remove stale #[allow(dead_code)] silencers on live code
Summary: Remove stale `#[allow(dead_code)]` attributes that mask unused code warnings, as confirmed by `arc rust-check`. These silencers can hide handler-registration bugs, like the one in D90503346 where `StreamingCloneHandler` was never registered. By removing them, the compiler can catch future regressions. This cleanup affects various modules, ensuring the compiler checks for dead code correctly. Reviewed By: lmvasquezg Differential Revision: D110174839 fbshipit-source-id: fdee189134ae88d7cf1e1323a521ce0bafee00ab
1 parent a74b3f2 commit dcc94a3

10 files changed

Lines changed: 0 additions & 12 deletions

File tree

‎eden/mononoke/clients/scsc/src/library/commit.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ fn render_date(
131131
Ok(())
132132
}
133133

134-
#[allow(dead_code)]
135134
pub(crate) fn render_commit_summary(
136135
commit: &CommitInfo,
137136
requested: &str,

‎eden/mononoke/clients/scsc/src/util.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ pub(crate) fn byte_count_iec(size: i64) -> String {
4747

4848
/// Convert a byte count to a human-readable representation of the byte count
4949
/// using short suffixes.
50-
#[allow(dead_code)]
5150
pub(crate) fn byte_count_short(size: i64) -> String {
5251
byte_count(size, "", "", &["K", "M", "G", "T", "P", "E", "Z", "Y"])
5352
}

‎eden/mononoke/common/reloader/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ impl<R> Reloader<R> {
4949
}
5050

5151
// Only used in tests
52-
#[allow(dead_code)]
5352
pub async fn wait_for_update(&self) {
5453
self.notify.notified().await;
5554
}

‎eden/mononoke/common/time_measuring/src/speed_sliding_window.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ impl BasicSpeedTracker {
137137
}
138138
}
139139

140-
#[allow(dead_code)]
141140
pub fn add_entry(&mut self) {
142141
self.add_entries(1)
143142
}

‎eden/mononoke/features/hooks/src/implementations/limit_users_directory_size.rs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const MAX_CONCURRENCY: usize = 100;
5050
/// This prevents individual user directories from growing too large due
5151
/// to RADAR rollout, which creates per-user working directories under
5252
/// this path.
53-
#[allow(dead_code)]
5453
#[derive(Deserialize, Clone, Debug)]
5554
pub struct LimitUsersDirectorySizeConfig {
5655
/// Max allowed recursive size in bytes for any directory at depth 2
@@ -63,13 +62,11 @@ pub struct LimitUsersDirectorySizeConfig {
6362
path_prefix: String,
6463
}
6564

66-
#[allow(dead_code)]
6765
#[derive(Clone, Debug)]
6866
pub struct LimitUsersDirectorySizeHook {
6967
config: LimitUsersDirectorySizeConfig,
7068
}
7169

72-
#[allow(dead_code)]
7370
impl LimitUsersDirectorySizeHook {
7471
pub fn new(config: &HookConfig) -> Result<Self> {
7572
Self::with_config(config.parse_options()?)

‎eden/mononoke/features/hooks/src/lua_pattern.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ impl LuaPattern {
154154
self.regex.is_match(s).unwrap_or(false)
155155
}
156156

157-
#[allow(dead_code)]
158157
pub fn get_regex(&self) -> &Regex {
159158
&self.regex
160159
}

‎eden/mononoke/jobs/cas_sync/src/errors.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ pub enum PipelineError {
2929
cause: Error,
3030
},
3131

32-
#[allow(dead_code)]
3332
#[error("error without tracking entry")]
3433
AnonymousError {
3534
#[source]

‎eden/mononoke/repo_attributes/bonsai_tag_mapping/src/cache.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub struct CachedBonsaiTagMapping {
4444
updater_task: JoinHandle<()>,
4545
}
4646

47-
#[allow(dead_code)]
4847
impl CachedBonsaiTagMapping {
4948
pub async fn new(
5049
ctx: &CoreContext,

‎eden/mononoke/repo_attributes/git_ref_content_mapping/src/cache.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ pub struct CachedGitRefContentMapping {
4040
updater_task: JoinHandle<()>,
4141
}
4242

43-
#[allow(dead_code)]
4443
impl CachedGitRefContentMapping {
4544
pub async fn new(
4645
ctx: &CoreContext,

‎eden/mononoke/tools/admin/src/commands/blobstore_bulk_unlink.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ async fn unlink_the_key_from_blobstore(
147147
Ok(())
148148
}
149149

150-
#[allow(dead_code)]
151150
struct BlobstoreBulkUnlinker {
152151
app: MononokeApp,
153152
keys_dir: String,

0 commit comments

Comments
 (0)