Utf8 prompts #281
Open
Utf8 prompts #281
Annotations
6 errors
Run Clippy:
src/editor.rs#L36
[clippy-x86_64-unknown-linux-gnu] reported by reviewdog 🐶
<pre><code>error: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/editor.rs:36:19
|
36 | fn dsp_width(msg: &String) -> usize { UnicodeWidthStr::width(msg.as_str()) + 1 }
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `-D clippy::ptr-arg` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ptr_arg)]`
help: change this to
|
36 | fn dsp_width(msg: &str) -> usize { UnicodeWidthStr::width(msg) + 1 }
| ~~~~ ~~~
</code></pre>
Raw Output:
src/editor.rs:36:19:e:
<pre><code>error: writing `&String` instead of `&str` involves a new object where a slice will do
--> src/editor.rs:36:19
|
36 | fn dsp_width(msg: &String) -> usize { UnicodeWidthStr::width(msg.as_str()) + 1 }
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `-D clippy::ptr-arg` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ptr_arg)]`
help: change this to
|
36 | fn dsp_width(msg: &str) -> usize { UnicodeWidthStr::width(msg) + 1 }
| ~~~~ ~~~
</code></pre>
__END__
|
Run Clippy:
src/editor.rs#L843
[clippy-x86_64-unknown-linux-gnu] reported by reviewdog 🐶
<pre><code>error: initializer for `thread_local` value can be made `const`
--> src/editor.rs:843:53
|
843 | thread_local! (static CHARACTER: RefCell<Vec<u8>> = {let cache = Vec::new(); RefCell::new(cache)});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { {let cache = Vec::new(); RefCell::new(cache)} }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
= note: `-D clippy::thread-local-initializer-can-be-made-const` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::thread_local_initializer_can_be_made_const)]`
</code></pre>
Raw Output:
src/editor.rs:843:53:e:
<pre><code>error: initializer for `thread_local` value can be made `const`
--> src/editor.rs:843:53
|
843 | thread_local! (static CHARACTER: RefCell<Vec<u8>> = {let cache = Vec::new(); RefCell::new(cache)});
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { {let cache = Vec::new(); RefCell::new(cache)} }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
= note: `-D clippy::thread-local-initializer-can-be-made-const` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::thread_local_initializer_can_be_made_const)]`
</code></pre>
__END__
|
Run Clippy:
src/editor.rs#L856
[clippy-x86_64-unknown-linux-gnu] reported by reviewdog 🐶
<pre><code>error: this let-binding has unit value
--> src/editor.rs:856:5
|
856 | let _ = character.clone().map_or((), |c| buffer.push_str(c.as_str()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `character.clone().map_or((), |c| buffer.push_str(c.as_str()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `-D clippy::let-unit-value` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::let_unit_value)]`
</code></pre>
Raw Output:
src/editor.rs:856:5:e:
<pre><code>error: this let-binding has unit value
--> src/editor.rs:856:5
|
856 | let _ = character.clone().map_or((), |c| buffer.push_str(c.as_str()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `character.clone().map_or((), |c| buffer.push_str(c.as_str()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
= note: `-D clippy::let-unit-value` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::let_unit_value)]`
</code></pre>
__END__
|
Run Clippy:
src/editor.rs#L856
[clippy-x86_64-unknown-linux-gnu] reported by reviewdog 🐶
<pre><code>error: matching over `()` is more explicit
--> src/editor.rs:856:9
|
856 | let _ = character.clone().map_or((), |c| buffer.push_str(c.as_str()));
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `-D clippy::ignored-unit-patterns` implied by `-D clippy::pedantic`
= help: to override `-D clippy::pedantic` add `#[allow(clippy::ignored_unit_patterns)]`
</code></pre>
Raw Output:
src/editor.rs:856:9:e:
<pre><code>error: matching over `()` is more explicit
--> src/editor.rs:856:9
|
856 | let _ = character.clone().map_or((), |c| buffer.push_str(c.as_str()));
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
= note: `-D clippy::ignored-unit-patterns` implied by `-D clippy::pedantic`
= help: to override `-D clippy::pedantic` add `#[allow(clippy::ignored_unit_patterns)]`
</code></pre>
__END__
|
Run Clippy:
src/editor.rs#L857
[clippy-x86_64-unknown-linux-gnu] reported by reviewdog 🐶
<pre><code>error: this let-binding has unit value
--> src/editor.rs:857:5
|
857 | let _ = character.map_or((), |_| CHARACTER.with(|cache| cache.borrow_mut().clear()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `character.map_or((), |_| CHARACTER.with(|cache| cache.borrow_mut().clear()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
</code></pre>
Raw Output:
src/editor.rs:857:5:e:
<pre><code>error: this let-binding has unit value
--> src/editor.rs:857:5
|
857 | let _ = character.map_or((), |_| CHARACTER.with(|cache| cache.borrow_mut().clear()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: omit the `let` binding: `character.map_or((), |_| CHARACTER.with(|cache| cache.borrow_mut().clear()));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
</code></pre>
__END__
|
Run Clippy:
src/editor.rs#L857
[clippy-x86_64-unknown-linux-gnu] reported by reviewdog 🐶
<pre><code>error: matching over `()` is more explicit
--> src/editor.rs:857:9
|
857 | let _ = character.map_or((), |_| CHARACTER.with(|cache| cache.borrow_mut().clear()));
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
</code></pre>
Raw Output:
src/editor.rs:857:9:e:
<pre><code>error: matching over `()` is more explicit
--> src/editor.rs:857:9
|
857 | let _ = character.map_or((), |_| CHARACTER.with(|cache| cache.borrow_mut().clear()));
| ^ help: use `()` instead of `_`: `()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ignored_unit_patterns
</code></pre>
__END__
|
The logs for this run have expired and are no longer available.
Loading