Skip to content

Conversation

Techcable
Copy link
Member

@Techcable Techcable commented Aug 8, 2025

This will make imports more convenient.

TODO: Decide if the following items should be included:

  • slog::FnValue
  • slog::Serde
  • slog::PushFnValue

EDIT: I conservatively decided against including these items.

EDIT 2: I decided to include the first two

@Techcable Techcable force-pushed the feature/slog-prelude branch from e58e46f to 8e11906 Compare August 21, 2025 01:18
@Techcable Techcable marked this pull request as ready for review August 21, 2025 01:19
@Techcable Techcable force-pushed the feature/slog-prelude branch 2 times, most recently from fe153b6 to 3343536 Compare August 21, 2025 01:22
@Techcable
Copy link
Member Author

Techcable commented Aug 21, 2025

I decided to include both slog::FnValue and slog::Serde as they are frequently useful and unlikely to cause conflicts with other bulk-imported modules.

Note that explicit imports always override bulk imports, so that the following code is unambiguous:

use self::conflicting::Serde;
use slog::prelude::*;

mod conflicting {
    pub struct Serde(pub i32);
}

fn main() {
    let x = Serde(3);
    let x: conflicting::Serde = x;
}

I have added a test for this to ensure this is always the case.

@Techcable Techcable force-pushed the feature/slog-prelude branch from 3343536 to 18120d6 Compare August 21, 2025 01:35
The FnValue/Serde types are included.
@Techcable Techcable force-pushed the feature/slog-prelude branch from 18120d6 to a31da4a Compare August 21, 2025 01:38
@Techcable Techcable requested a review from dpc August 27, 2025 17:35
@Techcable Techcable marked this pull request as draft August 27, 2025 19:01
@Techcable Techcable removed the request for review from dpc August 27, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants