mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 09:34:19 +01:00
note/options: remove redundant has function
there is a contains function generated by the bitflags macro Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -35,10 +35,6 @@ impl Default for NoteOptions {
|
||||
}
|
||||
|
||||
impl NoteOptions {
|
||||
pub fn has(self, flag: NoteOptions) -> bool {
|
||||
(self & flag) == flag
|
||||
}
|
||||
|
||||
pub fn new(is_universe_timeline: bool) -> Self {
|
||||
let mut options = NoteOptions::default();
|
||||
options.set(NoteOptions::HideMedia, is_universe_timeline);
|
||||
@@ -46,9 +42,9 @@ impl NoteOptions {
|
||||
}
|
||||
|
||||
pub fn pfp_size(&self) -> i8 {
|
||||
if self.has(NoteOptions::SmallPfp) {
|
||||
if self.contains(NoteOptions::SmallPfp) {
|
||||
ProfilePic::small_size()
|
||||
} else if self.has(NoteOptions::MediumPfp) {
|
||||
} else if self.contains(NoteOptions::MediumPfp) {
|
||||
ProfilePic::medium_size()
|
||||
} else {
|
||||
ProfilePic::default_size()
|
||||
|
||||
Reference in New Issue
Block a user