Skip to content

Commit c83afdf

Browse files
committed
Various changes.
1 parent f94c3b4 commit c83afdf

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/client.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ impl<'a> AuthenticatedState<'a> {
2121
}
2222
}
2323

24-
pub trait State: private::Sealed {}
24+
pub trait State: sealed::Sealed {}
2525

26-
mod private {
26+
mod sealed {
2727
pub trait Sealed {}
2828
}
2929

30-
impl private::Sealed for SimpleState {}
31-
impl private::Sealed for AuthenticatedState<'_> {}
30+
impl sealed::Sealed for SimpleState {}
31+
impl sealed::Sealed for AuthenticatedState<'_> {}
3232

3333
impl State for SimpleState {}
3434
impl State for AuthenticatedState<'_> {}
3535

3636
/// Represents clients generic over their *state*.
3737
#[derive(Debug, Clone, Default, Builder)]
38-
pub struct Client<S: State> {
38+
pub struct Client<S: State = SimpleState> {
3939
/// The session to use.
4040
pub session: Session,
4141
/// The state of the client, either *simple* or *authenticated*.
@@ -52,14 +52,14 @@ impl<S: State> Client<S> {
5252
pub type Simple = Client<SimpleState>;
5353

5454
/// Represents *authenticated* clients.
55-
pub type Authenticated<'c> = Client<AuthenticatedState<'c>>;
55+
pub type Authenticated<'a> = Client<AuthenticatedState<'a>>;
5656

5757
impl Simple {
5858
pub fn new(session: Session) -> Self {
5959
Self::builder().session(session).state(SimpleState).build()
6060
}
6161

62-
pub async fn login<'c>(credentials: Credentials<'c>) {}
62+
pub async fn login<'c>(&self, credentials: Credentials<'c>) {}
6363

6464
pub fn with_auth(self, auth: Auth<'_>) -> Authenticated<'_> {
6565
Authenticated::new(self.session, auth)

src/primitives/version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Version {
2121
pub const fn from_value(value: u8) -> Self {
2222
let (major, minor) = (value / BASE, value % BASE);
2323

24-
Self { major, minor }
24+
Self::new(major, minor)
2525
}
2626

2727
pub const fn into_value(self) -> u8 {

src/thunk.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ impl<'t, P: Processor> Thunk<'t, P> {
3939
}
4040
}
4141

42+
pub fn unprocess(&mut self) {}
43+
4244
pub fn to_unprocessed(&self) -> Result<Cow<'_, str>, P::UnprocessError> {
4345
match self {
4446
Unprocessed(unprocessed) => Ok(Cow::Borrowed(unprocessed)),

0 commit comments

Comments
 (0)