Description: avoid not-in-Debian crate profiling
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2024-03-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,6 @@
 log = "0.4"
 nom = "7.1"
 once_cell = "1.20"
-profiling = "1.0"
 regex = "1.11"
 thiserror = "2.0"
 
--- a/src/vobsub/idx.rs
+++ b/src/vobsub/idx.rs
@@ -34,7 +34,6 @@
     ///
     /// # Errors
     /// Will return VobSubError::Io if failed to open of read `.idx` or ``.sub`` file.
-    #[profiling::function]
     pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, VobSubError> {
         let path = path.as_ref();
         let mkerr_idx = |source| VobSubError::Io {
@@ -97,7 +96,6 @@
 ///
 /// # Panics
 /// Panic if the Regex creation failed
-#[profiling::function]
 pub fn read_palette<T, Err>(mut input: BufReader<T>, mkerr: &Err) -> Result<Palette, VobSubError>
 where
     T: std::io::Read,
--- a/src/vobsub/img.rs
+++ b/src/vobsub/img.rs
@@ -185,7 +185,6 @@
 /// Decompress a run-length encoded image, and return a vector in row-major
 /// order, starting at the upper-left and scanning right and down, with one
 /// byte for each 2-bit value.
-#[profiling::function]
 pub fn decompress(size: Size, data: &VobSubRleImageData) -> Result<Vec<u8>, Error> {
     trace!(
         "decompressing image {:?}, max: [0x{:x}, 0x{:x}]",
@@ -340,7 +339,6 @@
 {
     type Pixel = P;
 
-    #[profiling::function]
     fn to_image(&self) -> ImageBuffer<P, Vec<u8>>
     where
         P: Pixel<Subpixel = u8>,
@@ -393,7 +391,6 @@
 }
 
 impl ToOcrImage for VobSubOcrImage<'_> {
-    #[profiling::function]
     fn image(&self, opt: &ToOcrImageOpt) -> image::GrayImage {
         let width = self.indexed_img.width();
         let height = self.indexed_img.height();
--- a/src/vobsub/sub.rs
+++ b/src/vobsub/sub.rs
@@ -340,7 +340,6 @@
 
     // Read all pes_packets needed to parse a subtitle.
     fn next_sub_packet(&mut self) -> Option<Result<(f64, Vec<u8>), VobSubError>> {
-        profiling::scope!("VobsubParser next_sub_packet");
 
         // Get the `PES` packet containing the first chunk of our subtitle.
         let first: ps::PesPacket = try_iter!(self.pes_packets.next());
@@ -400,7 +399,6 @@
     type Item = Result<(TimeSpan, VobSubIndexedImage), VobSubError>;
 
     fn next(&mut self) -> Option<Self::Item> {
-        profiling::scope!("VobsubParser next");
 
         let (base_time, sub_packet) = try_iter!(self.next_sub_packet());
         let subtitle = subtitle::<(TimeSpan, VobSubIndexedImage), _>(&sub_packet, base_time);
--- a/src/image/utils.rs
+++ b/src/image/utils.rs
@@ -36,7 +36,6 @@
 /// # Errors
 /// Will return `DumpError::Folder` if the output folder creation failed.
 /// Will return `DumpError::DumpImage` if the dump of one image failed.
-#[profiling::function]
 pub fn dump_images<'a, Iter, Img, P, Container>(
     path: &str,
     images: Iter,
@@ -74,7 +73,6 @@
 }
 
 /// Dump one image
-#[profiling::function]
 fn dump_image<P, Pix, Container>(
     filename: P,
     image: &image::ImageBuffer<Pix, Container>, // image::Luma<u8>, Vec<u8>
--- a/src/pgs/pgs_image.rs
+++ b/src/pgs/pgs_image.rs
@@ -113,7 +113,6 @@
 {
     type Pixel = P;
 
-    #[profiling::function]
     fn to_image(&self) -> ImageBuffer<P, Vec<u8>>
     where
         P: Pixel<Subpixel = u8>,
@@ -138,7 +137,6 @@
 where
     C: Fn(LumaA<u8>) -> Luma<u8>,
 {
-    #[profiling::function]
     fn image(&self, opt: &ToOcrImageOpt) -> image::GrayImage {
         let width = self.rle_image.width();
         let height = self.rle_image.height();
--- a/src/pgs/sup.rs
+++ b/src/pgs/sup.rs
@@ -30,7 +30,6 @@
     }
 
     /// Create a parser for a `*.sup` file from the path of the file.
-    #[profiling::function]
     pub fn from_file<P>(path: P) -> Result<SupParser<BufReader<File>, Decoder>, PgsError>
     where
         P: AsRef<Path>,
