Skip to content

Commit

Permalink
update ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
tyreseluo committed Nov 28, 2024
1 parent 9ca4113 commit 8ae5b6c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 33 deletions.
5 changes: 1 addition & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
## Add these flags onto all target builds cumulatively.
## <https://github.com/rust-lang/cargo/issues/5376#issuecomment-2163350032>
[target.'cfg(all())']
rustflags = [
"--cfg", "ruma_identifiers_storage=\"Arc\"",
"-A", "clippy::all",
]
rustflags = ["--cfg", "ruma_identifiers_storage=\"Arc\""]

5 changes: 0 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Install required system dependencies
- run: sudo apt-get update
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev
- uses: dtolnay/rust-toolchain@stable
# Cache dependencies to speed up builds
- uses: Swatinem/rust-cache@v2
Expand All @@ -69,8 +66,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update
- run: sudo apt install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
Expand Down
19 changes: 2 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -208,26 +208,11 @@ unexpected_cfgs = "warn"
unnameable_types = "warn"
unused_import_braces = "warn"

## Configuration for clippy lints.
[lints.clippy]
collapsible_if = "allow"
collapsible_else_if = "allow"
too_many_arguments = "allow"
blocks_in_conditions = "allow"
used_underscore_binding = "allow"
module_name_repetitions = "allow"
correctness = "warn"
suspicious = "warn"
complexity = "warn"
perf = "warn"
needless_lifetimes = "warn"

cast_possible_truncation = "warn"
collection_is_never_read = "warn"
dbg_macro = "warn"
infinite_loop = "warn"
large_include_file = "warn"
large_stack_arrays = "warn"
match_same_arms = "warn"
mismatching_type_param_order = "warn"
partial_pub_fields = "warn"
return_self_not_must_use = "warn"
module_name_repetitions = "allow"
8 changes: 4 additions & 4 deletions src/home/room_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,7 @@ fn populate_image_message_content(
// then show a message about it being unsupported.
if let Some(mime) = mimetype.as_ref() {
if ImageFormat::from_mimetype(mime).is_none() {
text_or_image_ref.show_text(&format!(
text_or_image_ref.show_text(format!(
"{body}\n\nImages/Stickers of type {mime:?} are not yet supported.",
));
return true;
Expand All @@ -2983,21 +2983,21 @@ fn populate_image_message_content(
true
}
MediaCacheEntry::Requested => {
text_or_image_ref.show_text(&format!("{body}\n\nFetching image from {:?}", mxc_uri));
text_or_image_ref.show_text(format!("{body}\n\nFetching image from {:?}", mxc_uri));
// Do not consider this image as being fully drawn, as we're still fetching it.
false
}
MediaCacheEntry::Failed => {
text_or_image_ref
.show_text(&format!("{body}\n\nFailed to fetch image from {:?}", mxc_uri));
.show_text(format!("{body}\n\nFailed to fetch image from {:?}", mxc_uri));
// For now, we consider this as being "complete". In the future, we could support
// retrying to fetch the image on a user click/tap.
true
}
}
}
Some(MediaSource::Encrypted(encrypted)) => {
text_or_image_ref.show_text(&format!(
text_or_image_ref.show_text(format!(
"{body}\n\n[TODO] fetch encrypted image at {:?}",
encrypted.url
));
Expand Down
2 changes: 1 addition & 1 deletion src/shared/html_or_plaintext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl LiveHook for MatrixHtmlSpan {
if let Some(doc) = scope.props.get::<HtmlDoc>() {
let mut walker = doc.new_walker_with_index(scope.index + 1);
while let Some((lc, attr)) = walker.while_attr_lc(){
let attr = attr.trim_matches(&['"', '\'']);
let attr = attr.trim_matches(['"', '\'']);
match lc {
live_id!(color)
| live_id!(data-mx-color) => self.fg_color = Vec4::from_hex_str(attr).ok(),
Expand Down
3 changes: 1 addition & 2 deletions src/sliding_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1973,14 +1973,13 @@ async fn spawn_sso_server(
.identity_provider_id(&identity_provider_id)
.initial_device_display_name(&format!("robrix-sso-{brand}"))
.await
.map(|response| {
.inspect(|_| {
if let Some(client) = get_client() {
if client.logged_in() {
is_logged_in = true;
log!("Already logged in, ignore login with sso");
}
}
response
}) {
Ok(identity_provider_res) => {
if !is_logged_in {
Expand Down

0 comments on commit 8ae5b6c

Please sign in to comment.