Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MaybeUninit to avoid aliasing Vec and String while they can be moved. #30

Merged
merged 3 commits into from
Dec 13, 2024

Store the wrapped template of TemplateBuf in MaybeUninit.

28b2e9f
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Use MaybeUninit to avoid aliasing Vec and String while they can be moved. #30

Store the wrapped template of TemplateBuf in MaybeUninit.
28b2e9f
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Dec 13, 2024 in 0s

clippy

16 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 16
Note 0
Help 0

Versions

  • rustc 1.83.0 (90b35a623 2024-11-26)
  • cargo 1.83.0 (5ffbef321 2024-10-29)
  • clippy 0.1.83 (90b35a6 2024-11-26)

Annotations

Check warning on line 446 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:446:12
    |
446 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 377 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:377:43
    |
377 |         let template = ByteTemplate::from_slice(&*source)?;
    |                                                 ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 338 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:338:12
    |
338 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 220 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:220:12
    |
220 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 153 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:153:37
    |
153 |         let template = Template::from_str(&*source)?;
    |                                           ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 114 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:114:12
    |
114 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
    = note: `#[warn(clippy::explicit_auto_deref)]` on by default

Check warning on line 463 in src/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this manual char comparison can be written more succinctly

warning: this manual char comparison can be written more succinctly
   --> src/error.rs:463:32
    |
463 |     match source[position..].find(|c| c == '\n' || c == '\r') {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['\n', '\r']`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison

Check warning on line 456 in src/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this manual char comparison can be written more succinctly

warning: this manual char comparison can be written more succinctly
   --> src/error.rs:456:33
    |
456 |     match source[..position].rfind(|c| c == '\n' || c == '\r') {
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['\n', '\r']`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison
    = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default

Check warning on line 446 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:446:12
    |
446 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 377 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:377:43
    |
377 |         let template = ByteTemplate::from_slice(&*source)?;
    |                                                 ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 338 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:338:12
    |
338 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 220 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:220:12
    |
220 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 153 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:153:37
    |
153 |         let template = Template::from_str(&*source)?;
    |                                           ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref

Check warning on line 114 in src/template/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

deref which would be done by auto-deref

warning: deref which would be done by auto-deref
   --> src/template/mod.rs:114:12
    |
114 |             source: &*source,
    |                     ^^^^^^^^ help: try: `&source`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
    = note: `#[warn(clippy::explicit_auto_deref)]` on by default

Check warning on line 463 in src/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this manual char comparison can be written more succinctly

warning: this manual char comparison can be written more succinctly
   --> src/error.rs:463:32
    |
463 |     match source[position..].find(|c| c == '\n' || c == '\r') {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['\n', '\r']`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison

Check warning on line 456 in src/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this manual char comparison can be written more succinctly

warning: this manual char comparison can be written more succinctly
   --> src/error.rs:456:33
    |
456 |     match source[..position].rfind(|c| c == '\n' || c == '\r') {
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['\n', '\r']`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison
    = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default