[Observation] Unused import with allow annotation in landlock.rs

Resolved 💬 1 comment Opened Feb 10, 2026 by hobostay Closed Feb 10, 2026

Summary

The file codex-rs/linux-sandbox/src/landlock.rs contains an unused import use landlock::Access; that is suppressed with #[allow(unused_imports)].

Location

File: codex-rs/linux-sandbox/src/landlock.rs
Lines: 15-16

#[allow(unused_imports)]
use landlock::Access;

Observation

This import was added with an allow annotation, suggesting it was intentionally kept for a reason. However, I wanted to raise a few questions:

  1. Is this import planned for future use?
  • If there's a plan to use it soon, keeping it makes sense
  • If not, it might be cleaner to remove it and re-add when needed
  1. Was this part of a refactoring?
  • Sometimes imports remain after code changes
  • Removing unused imports can improve code clarity
  1. Would it be better to use a targeted allow?
  • Current: #[allow(unused_imports)] (applies to all unused imports in this scope)
  • Alternative: Only suppress this specific import: #[allow(dead_code)] use landlock::Access;

Code Context

The landlock crate is used for Linux sandbox security features. The Access type provides filesystem access rights, but it's not currently used in this file.

Suggested Actions

Depending on the team's plans:

Option A: Remove if not needed

// Remove the import entirely

Option B: Document why it's kept

// TODO: Will be used in upcoming landlock integration
#[allow(unused_imports)]
use landlock::Access;

Option C: Use it or remove it

If the import was meant to be used but wasn't, consider either implementing the intended functionality or removing it.

Impact

  • Priority: Very Low (code cleanliness)
  • Risk: None (compilation already works with the allow annotation)
  • Scope: Single file

Why Report This?

Even though this is minor, keeping code clean of unused imports helps:

  • Reduce confusion about what's actually being used
  • Make the codebase easier to navigate
  • Prevent potential future issues where someone tries to use Access thinking it's already imported

---
Note: I'm aware that external PRs are by invitation only. I'm submitting this as a minor code quality observation that the team can evaluate.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗