Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
f52acd9c
Commit
f52acd9c
authored
9 months ago
by
Jason Volk
Browse files
Options
Downloads
Patches
Plain Diff
Fix idiomatic let if
Signed-off-by:
Jason Volk
<
jason@zemos.net
>
parent
eae41fc4
No related branches found
No related tags found
1 merge request
!443
Lints
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Cargo.toml
+0
-1
0 additions, 1 deletion
Cargo.toml
src/api/client/account.rs
+4
-5
4 additions, 5 deletions
src/api/client/account.rs
src/api/client/sync.rs
+4
-5
4 additions, 5 deletions
src/api/client/sync.rs
with
8 additions
and
11 deletions
Cargo.toml
+
0
−
1
View file @
f52acd9c
...
@@ -721,7 +721,6 @@ option_if_let_else = { level = "allow", priority = 1 } # TODO
...
@@ -721,7 +721,6 @@ option_if_let_else = { level = "allow", priority = 1 } # TODO
redundant_pub_crate
=
{
level
=
"allow"
,
priority
=
1
}
# TODO
redundant_pub_crate
=
{
level
=
"allow"
,
priority
=
1
}
# TODO
significant_drop_in_scrutinee
=
{
level
=
"allow"
,
priority
=
1
}
# TODO
significant_drop_in_scrutinee
=
{
level
=
"allow"
,
priority
=
1
}
# TODO
significant_drop_tightening
=
{
level
=
"allow"
,
priority
=
1
}
# TODO
significant_drop_tightening
=
{
level
=
"allow"
,
priority
=
1
}
# TODO
useless_let_if_seq
=
{
level
=
"allow"
,
priority
=
1
}
# TODO
###################
###################
pedantic
=
"warn"
pedantic
=
"warn"
...
...
This diff is collapsed.
Click to expand it.
src/api/client/account.rs
+
4
−
5
View file @
f52acd9c
...
@@ -173,8 +173,7 @@ pub(crate) async fn register_route(body: Ruma<register::v3::Request>) -> Result<
...
@@ -173,8 +173,7 @@ pub(crate) async fn register_route(body: Ruma<register::v3::Request>) -> Result<
// UIAA
// UIAA
let
mut
uiaainfo
;
let
mut
uiaainfo
;
let
skip_auth
;
let
skip_auth
=
if
services
()
.globals.config.registration_token
.is_some
()
{
if
services
()
.globals.config.registration_token
.is_some
()
{
// Registration token required
// Registration token required
uiaainfo
=
UiaaInfo
{
uiaainfo
=
UiaaInfo
{
flows
:
vec!
[
AuthFlow
{
flows
:
vec!
[
AuthFlow
{
...
@@ -185,7 +184,7 @@ pub(crate) async fn register_route(body: Ruma<register::v3::Request>) -> Result<
...
@@ -185,7 +184,7 @@ pub(crate) async fn register_route(body: Ruma<register::v3::Request>) -> Result<
session
:
None
,
session
:
None
,
auth_error
:
None
,
auth_error
:
None
,
};
};
skip_auth
=
body
.appservice_info
.is_some
()
;
body
.appservice_info
.is_some
()
}
else
{
}
else
{
// No registration token necessary, but clients must still go through the flow
// No registration token necessary, but clients must still go through the flow
uiaainfo
=
UiaaInfo
{
uiaainfo
=
UiaaInfo
{
...
@@ -197,8 +196,8 @@ pub(crate) async fn register_route(body: Ruma<register::v3::Request>) -> Result<
...
@@ -197,8 +196,8 @@ pub(crate) async fn register_route(body: Ruma<register::v3::Request>) -> Result<
session
:
None
,
session
:
None
,
auth_error
:
None
,
auth_error
:
None
,
};
};
skip_auth
=
body
.appservice_info
.is_some
()
||
is_guest
;
body
.appservice_info
.is_some
()
||
is_guest
}
}
;
if
!
skip_auth
{
if
!
skip_auth
{
if
let
Some
(
auth
)
=
&
body
.auth
{
if
let
Some
(
auth
)
=
&
body
.auth
{
...
...
This diff is collapsed.
Click to expand it.
src/api/client/sync.rs
+
4
−
5
View file @
f52acd9c
...
@@ -1042,8 +1042,7 @@ fn load_timeline(
...
@@ -1042,8 +1042,7 @@ fn load_timeline(
sender_user
:
&
UserId
,
room_id
:
&
RoomId
,
roomsincecount
:
PduCount
,
limit
:
u64
,
sender_user
:
&
UserId
,
room_id
:
&
RoomId
,
roomsincecount
:
PduCount
,
limit
:
u64
,
)
->
Result
<
(
Vec
<
(
PduCount
,
PduEvent
)
>
,
bool
),
Error
>
{
)
->
Result
<
(
Vec
<
(
PduCount
,
PduEvent
)
>
,
bool
),
Error
>
{
let
timeline_pdus
;
let
timeline_pdus
;
let
limited
;
let
limited
=
if
services
()
if
services
()
.rooms
.rooms
.timeline
.timeline
.last_timeline_count
(
sender_user
,
room_id
)
?
.last_timeline_count
(
sender_user
,
room_id
)
?
...
@@ -1073,11 +1072,11 @@ fn load_timeline(
...
@@ -1073,11 +1072,11 @@ fn load_timeline(
// They /sync response doesn't always return all messages, so we say the output
// They /sync response doesn't always return all messages, so we say the output
// is limited unless there are events in non_timeline_pdus
// is limited unless there are events in non_timeline_pdus
limited
=
non_timeline_pdus
.next
()
.is_some
()
;
non_timeline_pdus
.next
()
.is_some
()
}
else
{
}
else
{
timeline_pdus
=
Vec
::
new
();
timeline_pdus
=
Vec
::
new
();
limited
=
false
;
false
}
}
;
Ok
((
timeline_pdus
,
limited
))
Ok
((
timeline_pdus
,
limited
))
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment