diff --git a/musikr/src/main/jni/build.rs b/musikr/src/main/jni/build.rs index bbdc45a01..49510530c 100644 --- a/musikr/src/main/jni/build.rs +++ b/musikr/src/main/jni/build.rs @@ -47,7 +47,7 @@ fn main() { } else { panic!("Unsupported Android target: {}", target); }; - + let clang_path = env::var("CLANG_PATH").expect("CLANG_PATH env var not set"); let toolchains_marker = "/toolchains"; let ndk_path = if let Some(pos) = clang_path.find(toolchains_marker) { diff --git a/musikr/src/main/jni/src/jstream.rs b/musikr/src/main/jni/src/jstream.rs index cd098af2f..b41bd8119 100644 --- a/musikr/src/main/jni/src/jstream.rs +++ b/musikr/src/main/jni/src/jstream.rs @@ -1,7 +1,7 @@ use crate::taglib::iostream::IOStream; +use crate::SharedEnv; use jni::objects::{JObject, JValue}; use std::io::{Read, Seek, SeekFrom, Write}; -use crate::SharedEnv; pub struct JInputStream<'local> { env: SharedEnv<'local>, @@ -9,10 +9,7 @@ pub struct JInputStream<'local> { } impl<'local, 'a> JInputStream<'local> { - pub fn new( - env: SharedEnv<'local>, - input: JObject<'local>, - ) -> Self { + pub fn new(env: SharedEnv<'local>, input: JObject<'local>) -> Self { Self { env, input } } } diff --git a/musikr/src/main/jni/src/lib.rs b/musikr/src/main/jni/src/lib.rs index efd0b9ad3..a2065caf2 100644 --- a/musikr/src/main/jni/src/lib.rs +++ b/musikr/src/main/jni/src/lib.rs @@ -1,14 +1,14 @@ -use std::cell::RefCell; -use std::rc::Rc; use jni::objects::{JClass, JObject}; use jni::sys::jstring; use jni::JNIEnv; +use std::cell::RefCell; +use std::rc::Rc; -mod taglib; mod jstream; +mod taglib; -use taglib::file_ref::FileRef; use jstream::JInputStream; +use taglib::file_ref::FileRef; type SharedEnv<'local> = Rc>>; @@ -50,8 +50,11 @@ pub extern "C" fn Java_org_oxycblt_musikr_metadata_MetadataJNI_openFile<'local>( None } }); - + // Return the title - let output = shared_env.borrow_mut().new_string("title").expect("Couldn't create string!"); + let output = shared_env + .borrow_mut() + .new_string("title") + .expect("Couldn't create string!"); output.into_raw() } diff --git a/musikr/src/main/jni/src/taglib/audioproperties.rs b/musikr/src/main/jni/src/taglib/audioproperties.rs index 5b26ecff8..b151a151b 100644 --- a/musikr/src/main/jni/src/taglib/audioproperties.rs +++ b/musikr/src/main/jni/src/taglib/audioproperties.rs @@ -2,7 +2,7 @@ use super::bridge::CppAudioProperties; use std::pin::Pin; pub struct AudioProperties<'file_ref> { - this: Pin<&'file_ref CppAudioProperties> + this: Pin<&'file_ref CppAudioProperties>, } impl<'file_ref> AudioProperties<'file_ref> { @@ -24,5 +24,5 @@ impl<'file_ref> AudioProperties<'file_ref> { pub fn channels(&self) -> i32 { self.this.as_ref().channels() - } -} \ No newline at end of file + } +} diff --git a/musikr/src/main/jni/src/taglib/bridge.rs b/musikr/src/main/jni/src/taglib/bridge.rs index 5d68722b1..51a6500a4 100644 --- a/musikr/src/main/jni/src/taglib/bridge.rs +++ b/musikr/src/main/jni/src/taglib/bridge.rs @@ -77,7 +77,7 @@ mod bridge_impl { #[cxx_name = "sampleRate"] fn sampleRate(self: Pin<&CppAudioProperties>) -> i32; #[cxx_name = "channels"] - fn channels(self: Pin<&CppAudioProperties>) -> i32; + fn channels(self: Pin<&CppAudioProperties>) -> i32; #[namespace = "TagLib::Ogg::Vorbis"] #[cxx_name = "File"] @@ -105,7 +105,9 @@ mod bridge_impl { #[cxx_name = "PictureList"] type CPPPictureList; #[namespace = "taglib_shim"] - fn PictureList_to_vector(list: Pin<&CPPPictureList>) -> UniquePtr>; + fn PictureList_to_vector( + list: Pin<&CPPPictureList>, + ) -> UniquePtr>; #[namespace = "taglib_shim"] #[cxx_name = "PicturePointer"] @@ -136,7 +138,7 @@ mod bridge_impl { #[cxx_name = "XiphComment"] type CPPXiphComment; #[cxx_name = "fieldListMap"] - fn fieldListMap(self: Pin<& CPPXiphComment>) -> &CPPFieldListMap; + fn fieldListMap(self: Pin<&CPPXiphComment>) -> &CPPFieldListMap; #[namespace = "TagLib"] #[cxx_name = "SimplePropertyMap"] @@ -164,8 +166,10 @@ mod bridge_impl { #[cxx_name = "FrameList"] type CPPID3v2FrameList; #[namespace = "taglib_shim"] - fn FrameList_to_vector(list: Pin<&CPPID3v2FrameList>) -> UniquePtr>; - + fn FrameList_to_vector( + list: Pin<&CPPID3v2FrameList>, + ) -> UniquePtr>; + #[namespace = "taglib_shim"] #[cxx_name = "FramePointer"] type CPPFramePointer; @@ -175,30 +179,41 @@ mod bridge_impl { #[cxx_name = "Frame"] type CPPID3v2Frame; #[namespace = "taglib_shim"] - unsafe fn Frame_asTextIdentification(frame: *const CPPID3v2Frame) -> *const CPPID3v2TextIdentificationFrame; + unsafe fn Frame_asTextIdentification( + frame: *const CPPID3v2Frame, + ) -> *const CPPID3v2TextIdentificationFrame; #[namespace = "taglib_shim"] - unsafe fn Frame_asUserTextIdentification(frame: *const CPPID3v2Frame) -> *const CPPID3v2UserTextIdentificationFrame; + unsafe fn Frame_asUserTextIdentification( + frame: *const CPPID3v2Frame, + ) -> *const CPPID3v2UserTextIdentificationFrame; #[namespace = "taglib_shim"] - unsafe fn Frame_asAttachedPicture(frame: *const CPPID3v2Frame) -> *const CPPID3v2AttachedPictureFrame; - + unsafe fn Frame_asAttachedPicture( + frame: *const CPPID3v2Frame, + ) -> *const CPPID3v2AttachedPictureFrame; #[namespace = "TagLib::ID3v2"] #[cxx_name = "TextIdentificationFrame"] type CPPID3v2TextIdentificationFrame; #[namespace = "taglib_shim"] - fn TextIdentificationFrame_fieldList(frame: Pin<&CPPID3v2TextIdentificationFrame>) -> UniquePtr; + fn TextIdentificationFrame_fieldList( + frame: Pin<&CPPID3v2TextIdentificationFrame>, + ) -> UniquePtr; #[namespace = "TagLib::ID3v2"] #[cxx_name = "UserTextIdentificationFrame"] type CPPID3v2UserTextIdentificationFrame; #[namespace = "taglib_shim"] - fn UserTextIdentificationFrame_fieldList(frame: Pin<&CPPID3v2UserTextIdentificationFrame>) -> UniquePtr; + fn UserTextIdentificationFrame_fieldList( + frame: Pin<&CPPID3v2UserTextIdentificationFrame>, + ) -> UniquePtr; #[namespace = "TagLib::ID3v2"] #[cxx_name = "AttachedPictureFrame"] type CPPID3v2AttachedPictureFrame; #[namespace = "taglib_shim"] - fn AttachedPictureFrame_picture(frame: Pin<&CPPID3v2AttachedPictureFrame>) -> UniquePtr; + fn AttachedPictureFrame_picture( + frame: Pin<&CPPID3v2AttachedPictureFrame>, + ) -> UniquePtr; #[namespace = "TagLib"] #[cxx_name = "String"] @@ -210,8 +225,10 @@ mod bridge_impl { #[cxx_name = "StringList"] type CPPStringList; #[namespace = "taglib_shim"] - fn StringList_to_vector(string_list: Pin<&CPPStringList>) -> UniquePtr>; - + fn StringList_to_vector( + string_list: Pin<&CPPStringList>, + ) -> UniquePtr>; + #[namespace = "TagLib"] #[cxx_name = "ByteVector"] type CPPByteVector; diff --git a/musikr/src/main/jni/src/taglib/file.rs b/musikr/src/main/jni/src/taglib/file.rs index 52ff9c914..470f2e243 100644 --- a/musikr/src/main/jni/src/taglib/file.rs +++ b/musikr/src/main/jni/src/taglib/file.rs @@ -1,14 +1,14 @@ -use std::pin::Pin; -use super::bridge::{self, CPPFile, CPPMPEGFile}; use super::audioproperties::AudioProperties; +use super::bridge::{self, CPPFile, CPPMPEGFile}; +use super::flac::FLACFile; +use super::id3v2::ID3v2Tag; use super::mpeg::MPEGFile; use super::ogg::OpusFile; use super::ogg::VorbisFile; -use super::flac::FLACFile; -use super::id3v2::ID3v2Tag; +use std::pin::Pin; pub struct File<'file_ref> { - this: Pin<&'file_ref mut CPPFile> + this: Pin<&'file_ref mut CPPFile>, } impl<'file_ref> File<'file_ref> { @@ -17,7 +17,7 @@ impl<'file_ref> File<'file_ref> { } pub fn audio_properties(&self) -> Option> { - let props_ptr = self.this.as_ref().audioProperties(); + let props_ptr = self.this.as_ref().audioProperties(); let props_ref = unsafe { // SAFETY: // - This points to a C++ FFI type ensured to be aligned by cxx's codegen. @@ -47,7 +47,7 @@ impl<'file_ref> File<'file_ref> { // - There are no datapaths that will yield any mutable pointers or references // to this, ensuring that it will not be mutated as per the aliasing rules. opus_file.as_mut() - }; + }; let opus_pin = opus_ref.map(|opus| unsafe { Pin::new_unchecked(opus) }); opus_pin.map(|opus| OpusFile::new(opus)) } diff --git a/musikr/src/main/jni/src/taglib/flac.rs b/musikr/src/main/jni/src/taglib/flac.rs index 52686e7b3..3f1056f97 100644 --- a/musikr/src/main/jni/src/taglib/flac.rs +++ b/musikr/src/main/jni/src/taglib/flac.rs @@ -1,14 +1,14 @@ pub use super::bridge::CPPFLACFile; pub use super::bridge::CPPFLACPicture; -pub use super::xiph::XiphComment; -use super::bridge::{CPPPictureList, PictureList_to_vector, FLACFile_pictureList, Picture_data}; +use super::bridge::{CPPPictureList, FLACFile_pictureList, PictureList_to_vector, Picture_data}; use super::tk::ByteVector; -use std::marker::PhantomData; +pub use super::xiph::XiphComment; use cxx::UniquePtr; +use std::marker::PhantomData; use std::pin::Pin; pub struct FLACFile<'file_ref> { - this: Pin<&'file_ref mut CPPFLACFile> + this: Pin<&'file_ref mut CPPFLACFile>, } impl<'file_ref> FLACFile<'file_ref> { @@ -44,7 +44,10 @@ pub struct PictureList<'file_ref> { impl<'file_ref> PictureList<'file_ref> { pub(super) fn new(this: UniquePtr) -> Self { - Self { _data: PhantomData, this } + Self { + _data: PhantomData, + this, + } } pub fn to_vec(&self) -> Vec> { @@ -71,7 +74,7 @@ impl<'file_ref> PictureList<'file_ref> { } pub struct Picture<'file_ref> { - this: Pin<&'file_ref CPPFLACPicture> + this: Pin<&'file_ref CPPFLACPicture>, } impl<'file_ref> Picture<'file_ref> { diff --git a/musikr/src/main/jni/src/taglib/id3v2.rs b/musikr/src/main/jni/src/taglib/id3v2.rs index f06b4dc2c..c4448ed45 100644 --- a/musikr/src/main/jni/src/taglib/id3v2.rs +++ b/musikr/src/main/jni/src/taglib/id3v2.rs @@ -1,14 +1,14 @@ use super::bridge::{ - self, CPPID3v2Frame, CPPID3v2TextIdentificationFrame, - CPPID3v2UserTextIdentificationFrame, CPPID3v2AttachedPictureFrame, CPPID3v2Tag, CPPID3v2FrameList + self, CPPID3v2AttachedPictureFrame, CPPID3v2Frame, CPPID3v2FrameList, CPPID3v2Tag, + CPPID3v2TextIdentificationFrame, CPPID3v2UserTextIdentificationFrame, }; use super::tk::{ByteVector, StringList}; -use std::pin::Pin; -use std::marker::PhantomData; use cxx::UniquePtr; +use std::marker::PhantomData; +use std::pin::Pin; pub struct ID3v2Tag<'file_ref> { - this: Pin<&'file_ref CPPID3v2Tag> + this: Pin<&'file_ref CPPID3v2Tag>, } impl<'file_ref> ID3v2Tag<'file_ref> { @@ -24,28 +24,34 @@ impl<'file_ref> ID3v2Tag<'file_ref> { pub struct FrameList<'file_ref> { _data: PhantomData<&'file_ref CPPID3v2FrameList>, - this: UniquePtr + this: UniquePtr, } impl<'file_ref> FrameList<'file_ref> { pub(super) fn new(this: UniquePtr) -> Self { - Self { _data: PhantomData, this } + Self { + _data: PhantomData, + this, + } } pub fn to_vec(&self) -> Vec> { let this = unsafe { Pin::new_unchecked(self.this.as_ref().unwrap()) }; let frames = bridge::FrameList_to_vector(this); - frames.iter().map(|frame| { - let frame_ptr = frame.get(); - let frame_ref = unsafe { frame_ptr.as_ref().unwrap() }; - let frame_pin = unsafe { Pin::new_unchecked(frame_ref) }; - Frame::new(frame_pin) - }).collect() + frames + .iter() + .map(|frame| { + let frame_ptr = frame.get(); + let frame_ref = unsafe { frame_ptr.as_ref().unwrap() }; + let frame_pin = unsafe { Pin::new_unchecked(frame_ref) }; + Frame::new(frame_pin) + }) + .collect() } } pub struct Frame<'file_ref> { - this: Pin<&'file_ref CPPID3v2Frame> + this: Pin<&'file_ref CPPID3v2Frame>, } impl<'file_ref> Frame<'file_ref> { @@ -54,27 +60,23 @@ impl<'file_ref> Frame<'file_ref> { } pub fn as_text_identification(&mut self) -> Option> { - let frame = unsafe { - bridge::Frame_asTextIdentification(self.this.as_ref().get_ref()) - }; + let frame = unsafe { bridge::Frame_asTextIdentification(self.this.as_ref().get_ref()) }; let frame_ref = unsafe { frame.as_ref() }; let frame_pin = frame_ref.map(|frame| unsafe { Pin::new_unchecked(frame) }); frame_pin.map(|frame| TextIdentificationFrame::new(frame)) } - pub fn as_user_text_identification(&mut self) -> Option> { - let frame = unsafe { - bridge::Frame_asUserTextIdentification(self.this.as_ref().get_ref()) - }; + pub fn as_user_text_identification( + &mut self, + ) -> Option> { + let frame = unsafe { bridge::Frame_asUserTextIdentification(self.this.as_ref().get_ref()) }; let frame_ref = unsafe { frame.as_ref() }; let frame_pin = frame_ref.map(|frame| unsafe { Pin::new_unchecked(frame) }); frame_pin.map(|frame| UserTextIdentificationFrame::new(frame)) } pub fn as_attached_picture(&mut self) -> Option> { - let frame = unsafe { - bridge::Frame_asAttachedPicture(self.this.as_ref().get_ref()) - }; + let frame = unsafe { bridge::Frame_asAttachedPicture(self.this.as_ref().get_ref()) }; let frame_ref = unsafe { frame.as_ref() }; let frame_pin = frame_ref.map(|frame| unsafe { Pin::new_unchecked(frame) }); frame_pin.map(|frame| AttachedPictureFrame::new(frame)) @@ -82,7 +84,7 @@ impl<'file_ref> Frame<'file_ref> { } pub struct TextIdentificationFrame<'file_ref> { - this: Pin<&'file_ref CPPID3v2TextIdentificationFrame> + this: Pin<&'file_ref CPPID3v2TextIdentificationFrame>, } impl<'file_ref> TextIdentificationFrame<'file_ref> { @@ -97,7 +99,7 @@ impl<'file_ref> TextIdentificationFrame<'file_ref> { } pub struct UserTextIdentificationFrame<'file_ref> { - this: Pin<&'file_ref CPPID3v2UserTextIdentificationFrame> + this: Pin<&'file_ref CPPID3v2UserTextIdentificationFrame>, } impl<'file_ref> UserTextIdentificationFrame<'file_ref> { @@ -112,7 +114,7 @@ impl<'file_ref> UserTextIdentificationFrame<'file_ref> { } pub struct AttachedPictureFrame<'file_ref> { - this: Pin<&'file_ref CPPID3v2AttachedPictureFrame> + this: Pin<&'file_ref CPPID3v2AttachedPictureFrame>, } impl<'file_ref> AttachedPictureFrame<'file_ref> { @@ -124,4 +126,4 @@ impl<'file_ref> AttachedPictureFrame<'file_ref> { let picture = bridge::AttachedPictureFrame_picture(self.this.as_ref()); ByteVector::new(picture) } -} \ No newline at end of file +} diff --git a/musikr/src/main/jni/src/taglib/iostream.rs b/musikr/src/main/jni/src/taglib/iostream.rs index a6795524b..5a256973f 100644 --- a/musikr/src/main/jni/src/taglib/iostream.rs +++ b/musikr/src/main/jni/src/taglib/iostream.rs @@ -1,27 +1,25 @@ - use super::bridge::{self, CPPIOStream}; -use std::io::{Read, Write, Seek, SeekFrom}; -use std::pin::Pin; use cxx::UniquePtr; +use std::io::{Read, Seek, SeekFrom, Write}; +use std::pin::Pin; -pub trait IOStream : Read + Write + Seek { +pub trait IOStream: Read + Write + Seek { fn name(&self) -> String; fn is_readonly(&self) -> bool; } - pub(super) struct BridgedIOStream<'io_stream> { rs_stream: Pin>>, - cpp_stream: UniquePtr + cpp_stream: UniquePtr, } impl<'io_stream> BridgedIOStream<'io_stream> { - pub fn new(stream: T) -> Self { + pub fn new(stream: T) -> Self { let mut rs_stream = Box::pin(DynIOStream(Box::new(stream))); let cpp_stream = bridge::wrap_RsIOStream(rs_stream.as_mut()); BridgedIOStream { rs_stream, - cpp_stream + cpp_stream, } } @@ -32,7 +30,7 @@ impl<'io_stream> BridgedIOStream<'io_stream> { impl<'io_stream> Drop for BridgedIOStream<'io_stream> { fn drop(&mut self) { - unsafe { + unsafe { // CPP stream references the rust stream, so it must be dropped first std::ptr::drop_in_place(&mut self.cpp_stream); std::ptr::drop_in_place(&mut self.rs_stream); @@ -44,7 +42,6 @@ impl<'io_stream> Drop for BridgedIOStream<'io_stream> { pub(super) struct DynIOStream<'io_stream>(Box); impl<'io_stream> DynIOStream<'io_stream> { - // Implement the exposed functions for cxx bridge pub fn name(&mut self) -> String { self.0.name() diff --git a/musikr/src/main/jni/src/taglib/mod.rs b/musikr/src/main/jni/src/taglib/mod.rs index d9ed9a183..bcab5451d 100644 --- a/musikr/src/main/jni/src/taglib/mod.rs +++ b/musikr/src/main/jni/src/taglib/mod.rs @@ -1,12 +1,12 @@ mod bridge; -pub mod file_ref; -pub mod iostream; -pub mod file; pub mod audioproperties; -pub mod ogg; +pub mod file; +pub mod file_ref; pub mod flac; -pub mod xiph; -pub mod mpeg; -pub mod tk; pub mod id3v2; +pub mod iostream; +pub mod mpeg; +pub mod ogg; +pub mod tk; +pub mod xiph; diff --git a/musikr/src/main/jni/src/taglib/mpeg.rs b/musikr/src/main/jni/src/taglib/mpeg.rs index 3e00baed3..97ad26b25 100644 --- a/musikr/src/main/jni/src/taglib/mpeg.rs +++ b/musikr/src/main/jni/src/taglib/mpeg.rs @@ -1,9 +1,9 @@ -use std::pin::Pin; use super::bridge::{self, CPPMPEGFile}; use super::id3v2::ID3v2Tag; +use std::pin::Pin; pub struct MPEGFile<'file_ref> { - this: Pin<&'file_ref mut CPPMPEGFile> + this: Pin<&'file_ref mut CPPMPEGFile>, } impl<'file_ref> MPEGFile<'file_ref> { diff --git a/musikr/src/main/jni/src/taglib/ogg.rs b/musikr/src/main/jni/src/taglib/ogg.rs index 8709bbcd3..ae4e23b0d 100644 --- a/musikr/src/main/jni/src/taglib/ogg.rs +++ b/musikr/src/main/jni/src/taglib/ogg.rs @@ -3,7 +3,7 @@ use super::xiph::XiphComment; use std::pin::Pin; pub struct VorbisFile<'file_ref> { - this: Pin<&'file_ref mut CPPVorbisFile> + this: Pin<&'file_ref mut CPPVorbisFile>, } impl<'file_ref> VorbisFile<'file_ref> { @@ -25,7 +25,7 @@ impl<'file_ref> VorbisFile<'file_ref> { } pub struct OpusFile<'file_ref> { - this: Pin<&'file_ref mut CPPOpusFile> + this: Pin<&'file_ref mut CPPOpusFile>, } impl<'file_ref> OpusFile<'file_ref> { diff --git a/musikr/src/main/jni/src/taglib/tk.rs b/musikr/src/main/jni/src/taglib/tk.rs index a24a7116e..066fc3296 100644 --- a/musikr/src/main/jni/src/taglib/tk.rs +++ b/musikr/src/main/jni/src/taglib/tk.rs @@ -1,17 +1,17 @@ use super::bridge::{self, CPPByteVector, CPPString, CPPStringList}; -use cxx::{UniquePtr, memory::UniquePtrTarget}; +use cxx::{memory::UniquePtrTarget, UniquePtr}; use std::marker::PhantomData; use std::pin::Pin; use std::{ffi::CStr, string::ToString}; -enum This<'file_ref, T : UniquePtrTarget> { +enum This<'file_ref, T: UniquePtrTarget> { Owned { data: PhantomData<&'file_ref T>, this: UniquePtr, - }, + }, Ref { this: Pin<&'file_ref T>, - } + }, } pub struct String<'file_ref> { @@ -24,7 +24,6 @@ impl<'file_ref> String<'file_ref> { } } - impl<'file_ref> ToString for String<'file_ref> { fn to_string(&self) -> std::string::String { let c_str = self.this.toCString(true); @@ -51,11 +50,18 @@ pub struct StringList<'file_ref> { impl<'file_ref> StringList<'file_ref> { pub(super) fn owned(this: UniquePtr) -> Self { - Self { this: This::Owned { data: PhantomData, this } } + Self { + this: This::Owned { + data: PhantomData, + this, + }, + } } pub(super) fn reference(this: Pin<&'file_ref CPPStringList>) -> Self { - Self { this: This::Ref { this } } + Self { + this: This::Ref { this }, + } } pub fn to_vec(&self) -> Vec { @@ -67,9 +73,7 @@ impl<'file_ref> StringList<'file_ref> { cxx_values .iter() .map(|value| { - let this = unsafe { - Pin::new_unchecked(value) - }; + let this = unsafe { Pin::new_unchecked(value) }; String::new(this).to_string() }) .collect() diff --git a/musikr/src/main/jni/src/taglib/xiph.rs b/musikr/src/main/jni/src/taglib/xiph.rs index 54f45dc36..34e8a9a09 100644 --- a/musikr/src/main/jni/src/taglib/xiph.rs +++ b/musikr/src/main/jni/src/taglib/xiph.rs @@ -1,12 +1,12 @@ pub use super::bridge::CPPXiphComment; -pub use super::flac::PictureList; use super::bridge::{CPPFieldListMap, FieldListMap_to_entries, XiphComment_pictureList}; +pub use super::flac::PictureList; use super::tk; -use std::pin::Pin; use std::collections::HashMap; +use std::pin::Pin; pub struct XiphComment<'file_ref> { - this: Pin<&'file_ref mut CPPXiphComment> + this: Pin<&'file_ref mut CPPXiphComment>, } impl<'file_ref> XiphComment<'file_ref> { @@ -17,7 +17,7 @@ impl<'file_ref> XiphComment<'file_ref> { pub fn field_list_map<'slf>(&'slf self) -> FieldListMap<'file_ref> { // To call the method we need, we have to get our mut reference down to an immutable // reference. The safe API can do this, but shortens the lifecycle to at most self, even - // though the reference really lives as long as file_ref. Sadly, this requires us to transmute + // though the reference really lives as long as file_ref. Sadly, this requires us to transmute // to extend the lifecycle back. This new pointer is really unsafe (we now have both a mut // and an immutable reference to the same object), but it's dropped after this call. // The value returned is unable to actually mutate this object, so it's safe.