Use `ObjectId::from()` or `ObjectId::try_from()` instead.
Unified · Split
| @@ -85,7 +85,7 @@ impl ObjectId { · 84 unmodified lines | |||
| 85 | /// | 85 | /// |
| 86 | /// Panics of the slice doesn't have a length of 20. | 86 | /// Panics of the slice doesn't have a length of 20. |
| 87 | #[inline] | 87 | #[inline] |
| 88 | pub fn from_20_bytes(b: &[u8]) -> ObjectId { | 88 | pub(crate) fn from_20_bytes(b: &[u8]) -> ObjectId { |
| 89 | let mut id = [0; SIZE_OF_SHA1_DIGEST]; | 89 | let mut id = [0; SIZE_OF_SHA1_DIGEST]; |
| 90 | id.copy_from_slice(b); | 90 | id.copy_from_slice(b); |
| 91 | ObjectId::Sha1(id) | 91 | ObjectId::Sha1(id) |