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 Option<&T> instead of &Option<T> #1338

Merged
merged 3 commits into from
May 6, 2024
Merged

use Option<&T> instead of &Option<T> #1338

merged 3 commits into from
May 6, 2024

Conversation

o2sh
Copy link
Owner

@o2sh o2sh commented May 6, 2024

As a follow up to #1335 (comment)

src/ui/mod.rs Outdated Show resolved Hide resolved
@@ -65,7 +65,7 @@ mod test {

#[test]
fn get_ascii_colors_no_custom_language_no_custom_colors_no_true_color() {
let colors = get_ascii_colors(&None, &Language::Rust, &[], false);
let colors = get_ascii_colors(None.as_ref(), &Language::Rust, &[], false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let colors = get_ascii_colors(None.as_ref(), &Language::Rust, &[], false);
let colors = get_ascii_colors(None, &Language::Rust, &[], false);

assert_eq!(colors.len(), 1);
assert_eq!(colors, vec![DynColors::Ansi(AnsiColors::Green)]);
}

#[test]
fn get_ascii_colors_no_custom_language_custom_colors_no_true_color() {
let colors = get_ascii_colors(&None, &Language::Rust, &[2, 3], false);
let colors = get_ascii_colors(None.as_ref(), &Language::Rust, &[2, 3], false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let colors = get_ascii_colors(None.as_ref(), &Language::Rust, &[2, 3], false);
let colors = get_ascii_colors(None, &Language::Rust, &[2, 3], false);

src/ui/mod.rs Outdated Show resolved Hide resolved
o2sh and others added 2 commits May 6, 2024 15:21
Co-authored-by: Spenser Black <[email protected]>
Co-authored-by: Spenser Black <[email protected]>
@o2sh o2sh merged commit 2c76c06 into main May 6, 2024
9 checks passed
@o2sh o2sh deleted the chore/refacto-option branch May 6, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants